MITB Banner

Sentiment Analysis Made Easy Using VADER

Share

Sentiment Analysis is used to analyse the emotion of the text. In other words, it is the process of detecting a positive or negative emotion of a text.

So, putting it in simple words, by using sentiment analysis we can detect whether the given sentence, paragraph or a document contains a positive or negative emotion/opinion in it.

Use-Case of Sentiment Analysis

Since customer nowadays is open and more abrupt in expressing their views about the products or services they use, sentiment analysis becomes an essential tool for the companies to know their customers in-depth and better.

Sentiment Analysis enables companies to know what kind of emotion/sentiment do customers have for them. This can play a huge role because companies can improve their products/services based on the analysis of customer sentiments.

Challenges Faced During Analysis of Sentiments

You might be thinking that a sentence having positive or good words will be analysed as positive sentiment & vice-versa a sentence having negative words will be analysed as the negative sentiment.

While the challenge here is that different people write their opinions in different ways, some people express their opinion straight while some may prefer adding sarcasm to their opinion. Also, some might have both positive and negative opinions.

For example: “This car is good but its mileage could’ve been better”

In the above scenario, the opinion of a user is on both sides. But we have a good solution for this situation which can to some extent can make our analysis easier. Let’s have a look at it in the upcoming paragraph.

Introducing VADER

VADER (Valence Aware Dictionary and sEntiment Reasoner) is a lexicon and rule-based sentiment analysis tool that is specifically attuned to sentiments expressed in social media. 

It is used for sentiment analysis of text which has both the polarities i.e. positive/negative. VADER is used to quantify how much of positive or negative emotion the text has and also the intensity of emotion.

Advantages

Here are the advantages of using VADER which makes a lot of things easier:

  • It does not require any training data.
  • It can very well understand the sentiment of a text containing emoticons, slangs, conjunctions, capital words, punctuations and much more.
  • It works excellent on social media text.
  • VADER can work with multiple domains.

Let’s start analysing the sentiment using VADER.

First, let’s install VADER from https://pypi.org/project/vaderSentiment/  by using the command line:

pip install vaderSentiment

Now, let’s start writing our script:

Here, SentimentIntensityAnalyzer() is an object and polarity_scores is a method which will  give us scores of the following categories:

  • Positive
  • Negative
  • Neutral
  • Compound

The compound score is the sum of positive, negative & neutral scores which is then normalized between -1(most extreme negative) and +1 (most extreme positive).

The more Compound score closer to +1, the higher the positivity of the text.

Above text is 49.2% Positive, 0% Negative, 50.8% Neutral. While the compound score is 44.04%.

Let’s look at some examples

Example-1

In the above scenario we can see that with the use of conjunction in a sentence, the positive & compound score has decreased.

——————————————————————————————————————————-

Example-2

In this scenario, with the use of smiley (emoji) in a sentence, the positive score and compound score has increased. 

——————————————————————————————————————————-

Example-3

Here we can see that with the use of capital word & exclamation mark, the positive score & compound score has increased. 

The second sentence is more intense, positive and so the compound score of the second sentence is more.

The compound score will increase as the intensity of the text will increase towards positive.

Conclusion:

VADER classifies the sentiments very well. It is easy to use, the ready-made model which can be used across multiple domains, social-media texts, analysing reviews etc. The cherry on the cake when using VADER is it does not require any training data. Well, we can see that the results obtained are very excellent!! 

Share
Picture of Falak Singh

Falak Singh

I am a Machine Learning Scientist and like to research the use cases of Artificial intelligence and how it can be leveraged for business purposes. The curiosity of knowing anything in-depth that is what defines me. Analytics is more about the interest in knowing anything in-depth and getting a result from the same. Apart from this, I am an Automobile fanatic and spend my time around it.
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India

Subscribe to Our Newsletter

The Belamy, our weekly Newsletter is a rage. Just enter your email below.