infer_sentiment
Parse text and calculate the overall positive or negative sentiment polarity.
Polarity is measured on the normalized scale [-1, 1]. The method used here is rather naïve. It simply looks up each word in the text in a “polarity lexicon”, which assigns each emotionally charged word a numeric score. The individual scores are then simply averaged across the whole text. This will hence not account for contexts involving irony, sarcasm, or even simple negations.
Was this page helpful?