Opinion Mining Using Tweets: 2020 US Presidential Elections Analysis

Verified

Added on  2022/10/02

|6
|1172
|26
Project
AI Summary
This project presents an analysis of the 2020 US Presidential Election using opinion mining techniques applied to Twitter data. The study focuses on analyzing tweets from five major US states to gauge public sentiment towards the election. The research methodology includes data collection via Twitter's streaming API, text pre-processing to clean the dataset, and sentiment analysis to classify tweets as positive, negative, or neutral. The project formulates research questions to determine if opinion mining can provide insights into the election and predict the re-election of Donald Trump. Findings reveal sentiment distributions across different states, suggesting a potential outcome for the election. The analysis also highlights limitations such as the time-consuming nature of data filtering and the challenges posed by ambiguous and sarcastic comments. The conclusion emphasizes the value of opinion mining in extracting sentiments from text data and offers predictions based on the analysis, suggesting that President Trump might not be re-elected, as many sentiments were negative, based on the data.
Document Page
Opinion Mining Through Tweets Giving Edge to Politics 2020 US Presidential Elections 1
Opinion Mining through Tweets Giving Edge to Politics of the 2020 US Presidential
Elections
By
(Name of Student)
(Institutional Affiliation)
(Professor’s Name)
(Date of Submission)
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Opinion Mining Through Tweets Giving Edge to Politics 2020 US Presidential Elections 2
Introduction
In the current world, social media is considered to have huge and an unprecedent amount
of opinionated data which one can deal with. Opinion mining is that branch of data analysis that
deals with the analysis of a person’s opinions and emotions related with particular services,
trending matters, associated organizations and events in general (Bo Yuan, 2016). Microblogging
site such as Twitter have become a huge mine of information on different topics of interest
(Meduru et al., 2017). People always tweet over latest happenings with a “hashtag” which is
considered as the fundamental topic for the examination. The data is usually collected by use of
the streaming API of Twitter (Gebrekirstos, 2011). This work represents the analysis of the
tweets through the use of opinion mining to predict the 2020 US presidential election. The tweets
from US citizens from five major states were selected for the analysis and the results discussed.
Research Methodology
The opinion mining by the use of Twitter Feeds assists in understanding the responses of the
masses in relation to the administrative matters and political transformations (Rao &
Ravichandran, 2018).
i. Data Collection
The data for this study was collected through streaming API of the Twitter as tweets that were
live were given top consideration.
ii. The Text Pre Processing
This refers to the process of clean up and preparation of the dataset for evaluation of the value of
the opinions and sentiments (Bo Yuan, 2016). The preparation of the dataset was done in such
ways such as removal of special characters, removal of URLs and Emojis and through removal
of slangs.
Document Page
Opinion Mining Through Tweets Giving Edge to Politics 2020 US Presidential Elections 3
iii. Analysis of the Sentiments
After refining of the data, the next step was to measure the opinion and the sentiments of the
tweets as either positive, negative or neutral. The positive sentiments according to the data
refinement refers to an opinion that Donald Trump would be elected as the president of the US in
2020. Negative sentiment on the other hand referred to the opinion that Trump will not be
elected as the president in the forthcoming election. The undecided citizens’ tweets were
classified as neutral opinions.
iv. Sampling Methods
The analysis is based on the dataset of about 30 million tweets that were collected over a period
of two months which are composed of the hashtags concerning the forthcoming 2020 politics and
election in the United States. The selected tweets from different parts of the US were selected for
the analysis. The tweets were further categorized according to the location of the tweeters and
the contents of the filtered and useful tweets.
Research Questions
For this study, the following research questions can be formulated;
i. Can opinion mining through tweets give an edge to politics of 2020 US presidential
elections?
ii. Can Donald Trump be re-elected in 2020 as the president of the United States?
Findings and Analysis
The results based on the analysis allows us to draw some opinions and predictions
relating to the forthcoming general election in the US. By analyzing the political conversation
data, the graphs below show the responses of the tweeters to the hashtag “Trump”. The pie charts
below represent the integration of the mass opinions from the major states along with the
Document Page
Opinion Mining Through Tweets Giving Edge to Politics 2020 US Presidential Elections 4
tweeters who disabled their locations on the Twitter. The regions in Green represent positive
sentiments, red region represent negative sentiments while blue region represent the neutral
sentiments. The table 1 below summarizes the different opinions of the tweeters from the
different regions of the United States.
Table 1: Tweeters Opinion Concerning 2020 US presidential Election
State/Region Positive
Sentiment
Negative
Sentiment
Neutral
Sentiment
Count
California 111,234 278,001 237,000 726,000
Washington DC 35,234 347,976 21,978 412,987
Chicago 95,678 564,457 34,678 701,231
Ohio 23,987 148,978 13,452 161,097
Disabled
Tweeters
10,234 211,314 230,001 461,897
TOTAL 278,956 1,234,786 612,907 1,456,876
Based on the table above, we are able to determine the exact number of tweets that were
collected and what the sentiments are about in respect to the major selected regions. Some of the
tweeters disabled their location and were thus taken into consideration. The above statistics were
thus used to construct various graphs for the understanding of this topic.
Limitations and Challenges
Though opinion mining is considered to be effective method, a number of challenges are
related to the use of this approach in performing the analysis and analyzing data. The approach
that was applied in analyzing the tweets was tiresome and time consuming since may tweets and
information were difficult to be filtered. Another challenge encountered was the ambiguity and
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Opinion Mining Through Tweets Giving Edge to Politics 2020 US Presidential Elections 5
sarcasm in some comments in the tweets from the users. This gave difficult time for one to
identify and choose whether to categorize the opinions as negative, neutral or positive.
Conclusion
In conclusion, opinion mining is a vital method of obtaining the sentiments from the
given context of a given sentence or from a given text information. Based on the results above, it
can be predicted that President Donald Trump may not be reelected in the year 2020 as many
sentiments were negative. The total number of tweets from the major states as per the analysis
suggests that many US citizens are not contented with Trump as the next president of US come
2020 US presidential election.
Document Page
Opinion Mining Through Tweets Giving Edge to Politics 2020 US Presidential Elections 6
References
Effective Text Data Cleaning [Online]. Available
https://www.analyticsvidhya.com/blog/2015/06/quick-guide-text-data-cleaning-python/
Mining and Preprocessing Twitter Data with Python [Online]. Available
https://marcobonzanini.com/2015/03/09/mining-twitter-data-with-python-part-2/
Useful Pandas Techniques in Python for Data Manipulation [Online].Available
https://www.analyticsvidhya.com/blog/2016/01/12-pandas-techniques-python-data-
manipulation/
Bo Yuan. (2016). Sentiment Analysis of Twitter Data.
Yuan, B. (2016). Sentiment Analysis of Twitter Data. Rensselaer Polytechnic Institute, New
York.
Meduru, M., Mahimkar, A., Subramanian, K., Padiya, P. Y., & Gunjgur, P. N. (2017). Opinion
Mining Using Twitter Feeds for Political Analysis. International Journal of
Computer, 25(1), 116-123.
Rao, D., & Ravichandran, D. (2018, March). Semi-supervised polarity lexicon induction.
In Proceedings of the 12th Conference of the European Chapter of the Association for
Computational Linguistics (pp. 675-682). Association for Computational Linguistics.
Gebrekirstos, G. (2011, May). Sentiment Analysis of Twitter Posts about News.
chevron_up_icon
1 out of 6
circle_padding
hide_on_mobile
zoom_out_icon
logo.png

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]