Skip to content

shreyalangar/Sentiment_Analysis_on_Political_Tweets

Repository files navigation

Sentiment Analysis on Political Tweets

Objective : This project aims at performing Sentiment Analysis by analyzing datasets containing political tweets from all over India by the use of NLP (Natural Language Processing).

Datasets : The datasets folder contains 3 CSV files: Narendra Modi_data.csv (Leader of BJP), Rahul Gandhi_data.csv (Leader of INC), Arvind Kejriwal_data.csv (leader of AAP). Each file contains 70k tweets respectively.

Columns :

  1. Date - Date of tweet
  2. User - Name of User
  3. Tweet - Tweet from user
  4. Time - Time of Tweet

Theory :

What is Sentiment Analysis?

Sentiment Analysis, as the name suggests, it means to analyze and find the emotion or intent behind a piece of text or speech or any mode of communication. This technique is performed on textual data and classifies its sentiment as positive, negative, or neutral to assist businesses in tracking consumer needs and comprehending their needs accordingly.

Why is Sentiment Analysis important in Politics?

In politics, sentiment analysis is used to understand public opinion about certain policies or politicians. This can guide political campaigns and strategies.

NLP (Natural Language Processing) : Natural Language Processing is a subfield of Artificial Intelligence that enables computers to understand, analyze, and manipulate human language.

Libraries used for NLP :

  1. nltk – Natural Language Toolkit is a collection of libraries for natural language processing
  2. stopwords – a collection of words that don’t provide any meaning to a sentence
  3. WordNetLemmatizer – used to convert different forms of words into a single item but still keeping the context intact.
  4. WordCloud – library to visualize text data

Steps followed in Jupyter Notebook :

  1. Importing necessary libraries
  2. Loading datasets
  3. Data preprocessing
  4. Exploratory Data Analysis
  5. Sentiment Analysis
  6. Conclusion

Screenshots :

image

image

image

image

image

image

image