Sentiment analysis is one of the most common tasks in Data Science and AI. In this article, we will use Python, Tweepy and TextBlob to perform sentiment analysis of a selected Twitter account using Twitter API and Natural Language Processing.

Introduction

We will use Twitter to perform sentiment analysis of the written text. We will use Twitter in this example but this can be also used in a business context to analyse different social media accounts, reviews of your company, reviews of your products and services, analysing support tickets, emails or free text from surveys to get an idea of the mood that is coming from people engaging with you and your business online.

What will you learn?

You will learn how to perform basic sentiment analysis using TextBlob; powerful Natural Language Processing library for Python. We will also use the WordCloud library to visualise some of our findings and we will also work with a Twitter API. Familiarizing with APIs is a useful skill for data scientists. It is a very common method of getting hold of the data from the internet.

Problem definition

Our task is to analyse the Tweets of an individual Twitter account in terms of Subjectivity and Polarity. We will identify individual tweets as positive, negative and neutral and calculate the percentage of positive tweets. We will use the WordCloud library to display a word cloud of the most positive words from the tweets.

#data-science #twitter #nlp #python #sentiment-analysis

Twitter Sentiment Analysis in Python
3.65 GEEK