Sentiment analysis types and approaches

Sentiment Analysis con Python

Violeta Misheva

Data Scientist

Levels of granularity

  1. Document level

  2. Sentence level

  3. Aspect level

The camera in this phone is pretty good but the battery life is disappointing.

Sentiment Analysis con Python

Type of sentiment analysis algorithms

  • Rule/lexicon-based

nice:+2, good:+1, terrible: -3 ...

Today was a good day.

  Today: 0, was:0, a:0, good:+1, day:0
  Total valence: +1

 

  • Automatic/ Machine learning
Sentiment Analysis con Python

What is the valence of a sentence?

text = "Today was a good day."
from textblob import TextBlob

my_valence = TextBlob(text)
my_valence.sentiment
Sentiment(polarity=0.7, subjectivity=0.6000000000000001)
Sentiment Analysis con Python

Automated or rule-based?

Automated/Machine learning

  • Rely on having labelled historical data
  • Might take a while to train
  • Latest machine learning models can be quite powerful

Rule/lexicon-based

  • Rely on manually crafted valence scores
  • Different words might have different polarity in different contexts
  • Can be quite fast
Sentiment Analysis con Python

Let's practice!

Sentiment Analysis con Python

Preparing Video For Download...