Himanshu Lohiya
2 min readJun 30, 2018

Sentiment Analysis with AFINN Lexicon

The AFINN lexicon is perhaps one of the simplest and most popular lexicons that can be used extensively for sentiment analysis.

The current version of the lexicon is AFINN-en-165. txt and it contains over 3,300+ words with a polarity score associated with each word. You can find this lexicon at the author’s official GitHub repository.

The author has also created a nice wrapper library on top of this in Python called afinn, which we will be using for our analysis.

Let’s look at some visualisations now.

We can see that the spread of sentiment polarity is much higher in sports and world as compared to technology where a lot of the articles seem to be having a negative polarity. We can also visualize the frequency of sentiment labels.

No surprises here that technology has the most number of negative articles and world the most number of positive articles.
Let’s get most positive and negative sentiment news articles for technology news.

No responses yet