Sentiment Analysis
By
Dr Sujata Khedkar
Sentiment analysis Problem definition
Implement sentiment analysis for any of the following domain
1. Services - hotel, hospital, airlines etc
2. Products - iphone, amazon any product, tv etc
Sample Dataset :
[Link]
Sentiment Analysis Libraries
● NLTK (Natural Language Toolkit): NLTK is a Python library that provides tools and resources for working with human
language data. It includes various lexicons and tools for performing sentiment analysis using lexicon-based
approaches.
● TextBlob: TextBlob is a simple Python library built on top of NLTK and Pattern. It offers an easy-to-use interface for
performing sentiment analysis, including lexicon-based sentiment analysis. TextBlob provides polarity and subjectivity
scores for text.
● VADER (Valence Aware Dictionary and sEntiment Reasoner): VADER is a lexicon and rule-based sentiment analysis
tool designed for social media text. It is available as part of the NLTK library and is particularly useful for analyzing
sentiment in short, informal text like tweets.
● AFINN: AFINN is a simple lexicon-based sentiment analysis tool for multiple languages. It assigns pre-defined
sentiment scores (ranging from negative to positive) to words and calculates the overall sentiment score for a piece
of text based on the words' scores.
● SentiWordNet: SentiWordNet is a lexical resource for sentiment analysis that assigns sentiment scores to synsets
(groups of synonymous words) in WordNet, a lexical database. It allows for more fine-grained sentiment analysis at
the synset level.
Sentiment classification techniques
• Sentiment Classification is a task that deals with automatically tagging text
as positive, negative or neutral from the perspective of speaker/writer with
respect to a topic.
v
Lexicon based Approach
Machine Learning based approach
Demo