2014-12-20 4 views

답변

1

끝점 http://access.alchemyapi.com/calls/text/TextGetTargetedSentiment을 사용할 때 필요한 매개 변수는 apikey 및 text뿐입니다. URL 매개 변수는 선택적이며 쿼리 문자열에 포함 할 필요가 없습니다. 긴 텍스트 블록을보고있는 경우 SDKs 중 하나를 사용하여 프로그래밍 방식으로 텍스트를 처리하는 것이 가장 효과적 일 수 있습니다.

0

전체 텍스트를 파일로 유지할 수 있습니다. 프로그램에서 내용을 문자열로 읽은 다음 API를 호출합니다.

String myText= getFileContents("c://myFileToAnalyse.txt"); 
AlchemyAPI_TargetedSentimentParams sentimentParams = new AlchemyAPI_TargetedSentimentParams(); 
sentimentParams.setShowSourceText(true); 

Document doc = alchemyObj.TextGetTargetedSentiment(myText, "keywords to analyse", sentimentParams); 
System.out.print(getStringFromDocument(doc));