Articles → NLP → Sentiment Intensity Analyzer In NLTK

Sentiment Intensity Analyzer In NLTK






Purpose





Example


import nltk
from nltk.sentiment import SentimentIntensityAnalyzer

# Download VADER lexicon (only once)
nltk.download("vader_lexicon")

# Create analyzer
sid = SentimentIntensityAnalyzer()

# Analyze sentiment
text = "I really like this product, it is amazing!"
scores = sid.polarity_scores(text)

print(scores)



Output


Picture showing different parameters of sentiment analysis when a sentiment of the word is analyzed




KeyMeaning
posPositive sentiment score
neuNeutral sentiment score
negNegative sentiment score
compoundOverall sentiment (-1 to +1)



Compound







Posted By  -  Karan Gupta
 
Posted On  -  Thursday, January 22, 2026

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250