Skip to content

Instantly share code, notes, and snippets.

@regunathanr
Created August 9, 2016 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save regunathanr/9fd9a0122cb0d42973d5209f15970c67 to your computer and use it in GitHub Desktop.
Save regunathanr/9fd9a0122cb0d42973d5209f15970c67 to your computer and use it in GitHub Desktop.
float Senti_score = (float)0.0;
for(int i=0; i < mp_obj.matching_phrases.size()-1;i++)
{
String mp_polarity = restTemplate.getForObject(gemfire_phrase_polarity_uri+mp_obj.matching_phrases.get(i),
String.class);
parseJSON_forscore(mp_polarity);
Senti_score = Senti_score + Float.valueOf(ret_senti_score);
}
if(mp_obj.matching_phrases.size() > 1)
{
Senti_score = Senti_score/(mp_obj.matching_phrases.size()-1);
}
result = message + "Sentiment score:"+Senti_score;
return result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment