Election prediction Using
Twitter Data
Internal Guide : Dr. Dinesh Kumar
Brighu Raina (91800150007)
Keshav Sharma(91800150006)
Ashish Pandya(91800151043)
Table Of Content
About the Project
About the background mathematical model
Proof
Dataset Used
Technologies Used
Conclusion
About The Project
● In this project we are going to predict the upcoming CM elections 2022
which is going to held in Punjab.
● We are using Twitter tweets for analyzing sentiments for prediction
● We have used NLP for cleaning and lemmatization and Text Blob for
sentimental analysis.
About the Mathematics lying behind
● Collecting Data -----> Using Twitter API
● NLTK ---------> For cleaning such as removing stop words from the Data
collected.
● Text Blob ------> Finding Polarity and subjectivity for sentimental analysis .
Text Blob uses Lexicon-based sentiment analyzer
● It has some predefined rules or we can say word and weight dictionary,
where it has some scores that help to calculate a sentence's polarity.
● A text message will be represented by bag of words After assigning
individual scores to all the words, final sentiment is calculated by some
pooling operation like taking an average of all the sentiments.
● Text Blob has semantic labels that help with fine-grained analysis. For
example — emoticons, exclamation mark, emojis, etc.
Sentimental Analysis using Text Blob
Polarity : Classifying Text positive and negative , float which lies in the range
of [-1,1] where 1 means positive statement and -1 means a negative
statement.
Subjectivity : Subjective sentences generally refer to personal opinion,
emotion or judgment whereas objective refers to factual information.
Subjectivity is also a float which lies in the range of [0,1].
Proof
● Worked on csv Data of American 2020 Presidential Election
● Used Same above Algorithm
Conclusion
Result was as same as it was in Reality . Joe Biden Won!!!!!
Dataset Used
Link to the dataset is:
https://www.kaggle.com/manchunhui/us-election-2020-tweets
https://developer.twitter.com/en/portal/projects/1496359852226260993/apps
For Reference :
https://towardsdatascience.com/my-absolute-go-to-for-sentiment-analysis-textblob-
3ac3a11d524
Technologies Used
- Python
- Twitter Api
- NLTK
- Text blob
Conclusion
From our prediction using twitter data we predict that ----> Charanjeet Singh
Channi of Congress is Going to Win the election
THANK YOU!!!

MAjor_Project_2_ppt.pptx

  • 1.
    Election prediction Using TwitterData Internal Guide : Dr. Dinesh Kumar Brighu Raina (91800150007) Keshav Sharma(91800150006) Ashish Pandya(91800151043)
  • 2.
    Table Of Content Aboutthe Project About the background mathematical model Proof Dataset Used Technologies Used Conclusion
  • 3.
    About The Project ●In this project we are going to predict the upcoming CM elections 2022 which is going to held in Punjab. ● We are using Twitter tweets for analyzing sentiments for prediction ● We have used NLP for cleaning and lemmatization and Text Blob for sentimental analysis.
  • 5.
    About the Mathematicslying behind ● Collecting Data -----> Using Twitter API ● NLTK ---------> For cleaning such as removing stop words from the Data collected. ● Text Blob ------> Finding Polarity and subjectivity for sentimental analysis .
  • 6.
    Text Blob usesLexicon-based sentiment analyzer ● It has some predefined rules or we can say word and weight dictionary, where it has some scores that help to calculate a sentence's polarity. ● A text message will be represented by bag of words After assigning individual scores to all the words, final sentiment is calculated by some pooling operation like taking an average of all the sentiments. ● Text Blob has semantic labels that help with fine-grained analysis. For example — emoticons, exclamation mark, emojis, etc.
  • 7.
    Sentimental Analysis usingText Blob Polarity : Classifying Text positive and negative , float which lies in the range of [-1,1] where 1 means positive statement and -1 means a negative statement. Subjectivity : Subjective sentences generally refer to personal opinion, emotion or judgment whereas objective refers to factual information. Subjectivity is also a float which lies in the range of [0,1].
  • 8.
    Proof ● Worked oncsv Data of American 2020 Presidential Election ● Used Same above Algorithm Conclusion Result was as same as it was in Reality . Joe Biden Won!!!!!
  • 9.
    Dataset Used Link tothe dataset is: https://www.kaggle.com/manchunhui/us-election-2020-tweets https://developer.twitter.com/en/portal/projects/1496359852226260993/apps For Reference : https://towardsdatascience.com/my-absolute-go-to-for-sentiment-analysis-textblob- 3ac3a11d524
  • 10.
    Technologies Used - Python -Twitter Api - NLTK - Text blob
  • 11.
    Conclusion From our predictionusing twitter data we predict that ----> Charanjeet Singh Channi of Congress is Going to Win the election THANK YOU!!!