VADER Sentiment Analysis

3.3.2 · active · verified Mon Apr 13

VADER (Valence Aware Dictionary and sEntiment Reasoner) is a lexicon and rule-based sentiment analysis tool, specifically attuned to sentiments expressed in social media, and effective on texts from other domains. The current version is 3.3.2, with releases occurring infrequently as it is a mature, rule-based system.

Warnings

Install

Imports

Quickstart

Initialize the SentimentIntensityAnalyzer and use the `polarity_scores()` method to get sentiment scores for a given text. The output is a dictionary containing negative ('neg'), neutral ('neu'), positive ('pos'), and a compound score ('compound').

from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer

analyser = SentimentIntensityAnalyzer()
sentence = "VADER sentiment analysis is incredibly insightful and super fun!"
scores = analyser.polarity_scores(sentence)
print(scores)

sentence_negative = "This product is absolutely terrible and a complete waste of money."
scores_negative = analyser.polarity_scores(sentence_negative)
print(scores_negative)

view raw JSON →