Skip to content

This project took place during the 2020 presidential election to weigh voters' emotional and rational tweets.

Notifications You must be signed in to change notification settings

SashaFlores/NLP_Election

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLP Election

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

This project was build using:

  • Liabraries:

    1. TextBlob to analyze sentiment
    2. WorldCloud to visualize data
    3. Pandas to read tweets in dataframe
    4. 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

Donald Trump tweets were:

  • 39.5 % Positive

  • 12.50 % Negative

  • 48 % Neutral

  • 140 times Exclamation Mark was used

Joe Biden tweets were:

  • 50 % Positive

  • 18 % Negative

  • 32 % Neutral

  • Exclamation Mark was used 4 times only.

Voters' favor Joe Biden over Donald Trump, their replies sentiment analysis shows:

  • 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


References

About

This project took place during the 2020 presidential election to weigh voters' emotional and rational tweets.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published