nltk.sentiment.SentimentIntensityAnalyzer¶
- class nltk.sentiment.SentimentIntensityAnalyzer[source]¶
Bases:
object
Give a sentiment intensity score to sentences.
- polarity_scores(text)[source]¶
Return a float for sentiment strength based on the input text. Positive values are positive valence, negative value are negative valence.
- Note
Hashtags are not taken into consideration (e.g. #BAD is neutral). If you are interested in processing the text in the hashtags too, then we recommend preprocessing your data to remove the #, after which the hashtag text may be matched as if it was a normal word in the sentence.