1) Please explain what is the functionality of TextGetTargetedSentiment.
2) Please provide Java code snippet calling TextGetTargetedSentiment.
EDIT
API info is at http://www.alchemyapi.com/api/sentiment/textc.html#targetedsentiment
As answered by Zach below, code snippet given by AlchemyAPI is
AlchemyAPI_TargetedSentimentParams sentimentParams = new AlchemyAPI_TargetedSentimentParams();
sentimentParams.setShowSourceText(true);
doc = alchemyObj.TextGetTargetedSentiment("This car is terrible.", "car", sentimentParams);
System.out.print(getStringFromDocument(doc));
Result is
:
<totalTransactions>1</totalTransactions>
<language>english</language>
<text>This car is terrible.</text>
<docSentiment>
<score>-0.776261</score>
<type>negative</type>
</docSentiment>
If we change a statement to
"This car is superb." Then result is
:
<totalTransactions>1</totalTransactions>
<language>english</language>
<text>This car is superb.</text>
<docSentiment>
<score>0.695491</score>
<type>positive</type>
</docSentiment>
All files