Simplifying Sentiment Analysis using VADER in Python (on Social Media Text)

An easy to use Python library built especially for sentiment analysis of social media texts.

Parul Pandey
Analytics Vidhya
Published in
8 min readSep 23, 2018

--

PC:Pixabay/PDPics

“If you want to understand people, especially your customers…then you have to be able to possess a strong capability to analyze text. “ — Paul Hoffman, CTO:Space-Time Insight

The 2016 US Presidential Elections were important for many reasons. Apart from the political aspect, the major use of analytics during the entire canvassing period garnered a lot of attention. During the elections, millions of Twitter data points, belonging to both Clinton and Trump, were analyzed and classified with a sentiment of either positive, neutral, or negative. Some of the interesting outcomes that emerged from the analysis were:

  • The tweets that mentioned ‘@realDonaldTrumpwere greater than those mentioning@HillaryClinton’, indicating the majority were tweeting about Trump.
  • For both candidates, negative tweets outnumbered the positive ones.
  • The Positive to Negative Tweet ratio was better for Trump than for Clinton.

This is the power that sentiment analysis brings to the table and it was quite evident in the U.S elections. Well, the Indian Elections are around the corner too and sentiment analysis will have a key role to play there as well.

What is Sentiment Analysis?

source

Sentiment Analysis, or Opinion Mining, is a sub-field of Natural Language Processing (NLP) that tries to identify and extract opinions within a given text. The aim of sentiment analysis is to gauge the attitude, sentiments, evaluations, attitudes and emotions of a speaker/writer based on the computational treatment of subjectivity in a text.

Why is sentiment analysis so important?

--

--

Parul Pandey
Analytics Vidhya

Principal Data Scientist @H2O.ai | Author of Machine Learning for High-Risk Applications