Analyzing each candidate tweets and replies they received, to predict 2020 presidential elections
- Please note beacuse of time limitation on this project, classification algorithum isn't included yet in this project which was initialized on an automatic approach but all sentiment analysis are covered
-
Liabraries:
- TextBlob to analyze sentiment
- WorldCloud to visualize data
- Pandas to read tweets in dataframe
- Matplotlib to visualize data
-
Tweepy Installation:
pip install tweepy
-
Sign up for Twitter Developer account to generate necessary tokens & keys
-
each candidate: using API feature "user_timeline" This feature has a limitation on the number of tweets requested up to 200 maximum.
-
replies to each candidate: using tweepy feature "Cursor" This feature can iterate through 10,000 tweets per request maximum which will increase our analysis accuracy.
-
Polarity & Context : to measure Emotional reactions, where 1 is positive, 0 is neutral, & -1 is negative.
-
Subjectivity & Tone: to measure Rational reactions, where 0 is objective& 1 is subjective
-
Emojis
-
Irony and Sarcasm
-
39.5 % Positive
-
12.50 % Negative
-
48 % Neutral
-
140 times Exclamation Mark was used
-
Positive replies scored 58.76 % for Joe Biden & 47.22 % for Donald Trump
-
Negative replies scored 41.22 % for Joe Biden & 52.78 % for Donald Trump
- Users' replies to Donald Trump tweets
- Users' replies to Donald Trump tweets