Analyzing Public Sentiments on Gun Control through Twitter: A Machine Learning Approach

Verified

Added on  2023/06/15

|13
|3210
|210
AI Summary
This research paper analyzes public sentiments on gun control through Twitter using machine learning approach. The paper discusses the advantages of using Twitter for sentimental analysis and the steps involved in data collection, pre-processing, classification, summaries, and data visualization. The results show that pro-gun sentiments were the leading followed by neutral and anti-gun sentiments.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Running head: OPERATIONS MANAGEMENT 1
Operations Management
Name
Institution affiliation

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
OPERATIONS MANAGEMENT 2
Introduction
Violence related to gun has become a complex matter and it is accountable for a
massive populace of the violent incidents. For instance, in December 2012 a profoundly
armed young man having mental illness found right of entry to his mother’s lawfully
possessed guns and gunshot all the way into the protected apartment of the Sandy Hook
Elementary School (SHES) in Connecticut, USA (Benton et al., 2016). Certainly within a
short span of less than fifteen minutes the young man had killed approximately 26 people
consisting of six adults and twenty kids (Wang, Varghese, & Donnelly, 2016). Furthermore,
before the incident of SHES the young man had murdering his mother in the bed and lastly he
killed himself. As a result of this mass shooting that happened at Sandy Hook Elementary
School it led to a heated debate as well as legislation regarding gun regulation across the
entire United States. Accordingly, social media played a lively public debate with individuals
expressing different views both for and against gun legislation. Certainly, much focus
regarding this incident of mass shooting was primarily based on gun ownership and gun
control with people giving different views advocating for tougher gun control. Indeed, the
tougher gun control views has been in clash with the America Constitutional second
amendment advocating for the right to hold firearms.
On the same note while the public opinion has been on the front in fighting for
tougher firearm control rules for more than twenty years, the centralized gun control laws has
been a heatedly debated topic facing small legislative progress in which even the local
restraints have been met with obstruction. Basically, this debate is ongoing and in its totality
it is past the scope of this report restrict itself to looking forward to comprehend and interpret
pro-gun as well as anti-gun sentiments conveyed through social media stand particularly
Twitter. Indeed, since the birth of social media, microblogging has become a famous
communication component among users of the internet. The research make use of Twitter
Document Page
OPERATIONS MANAGEMENT 3
because it is a free and easily accessible microblogging service that tend to take over from the
traditional communication tools like mailing lists and blogs. Therefore, the daily upsurge in
the number of users keep on sending out millions of messages across the website which are
precisely created for the purpose Twitter, Facebook and Tumblr only to mention a few. The
content of these messages discusses a range of topics. Thus, social media has allowed users to
write their opinion about society, share views and divulge ideas. With the rise in users
creating content of different varieties on social media platforms such as marketing views,
political or religion has made microblogging an interesting source of opinion mining as well
as sentimental analysis. For instance in the case of marketing sentiment analysis it is capable
to determine if consumers like or dislike a given product. In the case of politics sentiment
analysis is used to collect information regarding political party activities such as whether the
party support or does not support a party’s political agenda.
So as to realise this the research paper make use of machine learning which
illustration more than 300,000 tweets made by people in the U.S. which comprise one or
more pre-set significant key words. Ideally, the target of this research is to attain the pro-gun
and anti-gun emotion and the manner in which it transformed over time. Consequently, the
researcher explore the viability of taking machine learning approach to sentimental analysis
as well as stance detection for political tweets. Accordingly, a machine learning system is
trained to deduct sentiment information from tweets that is a tweet which is formulated
neutrally, negatively or positively. Moreover, the machine learning is trained to analyse the
stance recognition that is when an individual is against, in favour of or neutral towards a
given subject matter and in this case gun control in the U.S (Vizzard, 2014). certainly, for
further description the researcher will expound more about Twitter, sentimental analysis and
lastly but not least stance discovery.
Twitter
Document Page
OPERATIONS MANAGEMENT 4
In this case the researcher make use of Twitter because it has various advantages
which makes it a significant tool for sentimental analysis. Indeed, twitter is a free online
social media platform where users are capable of sharing messages freely which are
commonly referred to as tweets (Stefanone et al., 2015). Every tweet is restricted to a specific
number of characters and before November 2017 twitter only allowed users to tweet a
maximum of 140 characters for each tweet. Nevertheless, after the update in November 2017
one tweet can vary in length from between one character and 280 characters. Although tweets
vary based on the discussion topic these tweets differ in various ways such as in terms of
content and writing depending the user’s background. The advantage is that microblogging
service Twitter is capable of collecting tweets from individuals with dissimilar cultural, social
and economic settings. On the same note, twitter users use different words with different
meanings thus the data has to be gathered in various languages (O’Brien, Forrest, Lynott, &
Daly, 2013). As a result, research has shown that microblogging services are not limited to
only one language but many languages because of the numerous people with different
nationalities in the U.S.
Similarly, the database of twitter keep on growing each day thus Twitter is an infinite
data resource. Accordingly, with regard to the number of characters of each tweet, the
gigantic audience as well as the ever-expanding database it leaves Twitter as the most ideal
microblogging service for gathering and analysing data for the purpose of gun control
sentimental analysis and stance recognition. In the context of gun control twitter sentimental
analysis the research will develop a structure to gather, pre-processes and categorise tweets
on gun control (Benton et al., 2016). Therefore, the researcher will use an indicator curated
gold normal dataset in categorising the whole research sample. The research will use different
machine learning strategies and then evaluate these approaches to offer maximum
accurateness over a trivial section to be used for categorising the whole tweet model. The

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
OPERATIONS MANAGEMENT 5
researcher will visualize the tweet sentiments by taking each state into consideration based on
the number of people in possession of guns using the application hosted at
http://www.guncontrolontwitter.com. Therefore, the research will gather, pre-process
categorise and summarise as well as visualize the sentiments of the tweet in the methodology
section. The methodology part use different machine languages to classify the tweets son gun
control.
Research questions and Hypothesis
Research questions
In the case of this research the researcher will use the following questions:
What is the yearly trend on tweets about gun control?
At what frequency does the word “gun control” appear in the tweet over time?
What is the comparison of tweets for pro-gun and anti-gun with and without emoticons and
polarity?
Hypothesis
H0: The tweet sentiment analysis packages such as TextBlog, nltk, and Scikit Learn are
effective approaches for polarity and subjective analysis.
Methodology
The procedure for analysing public sentiments about gun control involves various
processes by incorporating machine learning through the following approach data collection,
pre-processes, classification, summaries and data visualization. Accordingly, the figure
bellow illustrates the steps undertaken. Thus, there are different functions which can be
Document Page
OPERATIONS MANAGEMENT 6
employed to stem significant information which is pragmatic in categorizing the tweets. The
outcomes will be potted using veracious visualization techniques.
Steps for evaluating and envisioning public sentiment on gun control
Therefore, unstructured statistics from Twitter is gathered and pre-processed by being
transformed into a clipped set of data in the most applicable structure that is further divided
into preparation and analysis data sets. At the machine learning level there are various
algorithms like Maximum Entropy (ME), Support Vector Machines (SVM), Neutral Network
(NN), Random Forest (RF) and Boosted Tree are investigated to develop the classifiers.
Accordingly, a subclass of more precise classifiers are employed for categorising the tweets.
Therefore, the collection process involves various steps:
Data collection: The raw tweet data is in JSON format is bought from GNIP which is an
authorized third party that resells historical tweets that is determined by predetermined
standards which filter data according to the period, key words as well as the user’s
geographical location. In comparison with other alternatives like tradition built web flatterers
Document Page
OPERATIONS MANAGEMENT 7
and programming the Twitter Streaming API. Accordingly, this method is suitable in the
sense that it saves time and also offer data in a consistent structure despite the fact that the
tweets have to be purchased.
Pre-processing: The research will utilize a case comprising a list of JSON files as well as
their local settings which was found from the GNIP reseller. Every JSON file is arranged for
a period of ten minutes which covers a huge amount of data about the gun control tweets. The
JSON files are analysed to mine the most significant data for the study which is later on
converted into the comma-separated values (CSV) format. Furthermore, additional tasks will
be converted with the help of the R programming language in RStudio. Accordingly, the
researcher preferred using the R programming language because it has the capacity to readily
exploit the enthusiastically existing packages for data mining as well as natural language
processing.
Classification: At the machine learning phase, the feelings of every tweet is extracted. The
preparation set of data consists of 5000 tweets which are designated from the clipped data
whereas the outstanding tweets which are remaining for grouping. Therefore, the views of
every tweet is physically labelled using three categories that is neutral, pro-gun, and anti-gun
to gain a gold standard set of data (Saif, He, & Alani, 2012). The assumption made is that the
total number of tweets is not equal amongst the three groups based on Twitter features.
Indeed, Twitter is an appropriate platform that is used to illustrate the subjective concepts
which illustrate pro-gun and anti-gun control views.
Summary: The researcher use different calculation to calculate the Pro-Gun Public Sentiment
Scores (PGSS) for comparison. Therefore, the investigator account for geographic and time
frame described by g and t respectively. The baseline is denoted in the following manner
PGSS = positive tweets count (g,t)/ Negative tweets count (g,t)

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
OPERATIONS MANAGEMENT 8
The PGSS baseline measures the amount of pro-gun tweets against anti-gun tweets from a set
of tweets coming from given state within the specified time frame. All the GPSS scores are
normalised between zero and one for purposes of visualisation.
Visualization: A web app is created under the gun control context for purposes of data
visualization. The researcher will use geographic maps generated using Goggle Charts API
and Motion charts using the googleVis package. The applied techniques will present the
results ranging from the state, and county level in addition to daily analysis. The geographic
map visualizes a sequence of PGPSS outcome. The line graph exemplify the number of
categorised tweets over a specified period.
Model
The researcher used several predictive models using the training set of data found
from machine learning methods such as Random Forest (RF), Support Vector Machine
(SVM), Maximum Entropy (ME), Boosting and Neutral Network (NN). All these machine
learning techniques are inbuilt with RTextTools. The SVM machine learning make use of
kernels to determine the hyperplane which splits the data into various classes with the
maximum margin. On the other hand, Maximum Entropy (ME) is a classification approach
which uses general logistics regression to a range of class problems by projecting the
possibilities of dissimilar possible outcomes. Accordingly, so as to minimize biases of an
extrapolative model in contrast to data which is classified incorrectly, the boosting algorithm
build a strong classifier over a weaker one by iteratively adding more weight to data that is
misclassified. The Neutral Network (NN) perform non-linear statistical modelling which is
powerful against noise as well as generalisation.
Results
Document Page
OPERATIONS MANAGEMENT 9
The study’s significant tweets were found from GNIP through supplication of various
filter regulations. The standards included key words and phrases like gun, gun violence and
firearm and hashtags like #Gun Control with a range of filters like the source of the tweet,
used and language. At the time of pre-processing vital information like dates, tweets as well
as geographical locations were extracted (Davidov, Tsur, & Rappoport, 2010). In addition a
golden training set of data was physically of 5000 tweets was chosen and categorized based
on the following sentiment to the event.
Neutral: This classification comprised irrelevant information which does no convey pro-gun
or anti-gun sentiment.
Anti-gun: This are tweets which were in favour of gun control and it was an expression of the
sympathy and atrocity. For instance, “We need stricter gun control regulations.”
Pro-gun: These tweets that were in favour of the freedom to possess guns that is these are
individuals who are against gun control. For instance, “The only way to stop a bad person
with a gun, is a good person with a gun” and “gun control cannot help”.
Document Page
OPERATIONS MANAGEMENT
10
Figure 1: Machine Learning Approaches used to Analyse Twitter Gun Control Sentiments
Based on the results in the table above it shows that pro-gun sentiments was the
leading followed by neutral and anti-gun sentiments.
Discussion
Indeed, the incident of Sandy Hook school genocide was a distressing as well as
tragic incident. As a result, the event led to a heated debate about the gun ownership as well
as mental health. However, the mental health matter is not discussed in this report.
Nonetheless, the access to gun by individual who have mental problems is a clear indication
of the recklessness shown by people in possession of firearms. Accordingly, the incident
exemplify that people in possession of guns do not take a right precautions to safeguarding
these arms but keep at the disposal of any person even kids who do not know how the
ammunition ought to be used.
Conclusion
The researcher explores the effectiveness of machine learning systems which perform
sentimental analysis on 5000 tweets regarding gun control in various states in the United
States. Therefore, the researcher classified the machine language on the three basis that is
pro-gun, neutral and anti-gun sentiments. Accordingly, sentimental analysis of social media is
a significant path of study in the field of natural language processing. Certainly, the
researcher employed Twitter sentiment because it is less number of characters which make it
a more suitable approach for easy analysis of the results. The research has shown that is
probable to analyse data from social media with the help of machine learning in a dependable
and replicable manner. Accordingly, this is made possible through the approach of collecting,
training and categorising tweets. In this light, sentiment analysis indicate that the peak of
anti-gun emotions regarding the Sandy Hook school shooting but it rapidly drops to pre-event

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
OPERATIONS MANAGEMENT
11
levels. Nonetheless, while most individuals are for pro-gun sentiments the way in which these
firearms are kept is the major challenges among people in possession of guns (Kleck, Gertz,
& Bratton, 2009). Consequently, there is need to come up stricter gun control measures to
ensure that gun owners keep their guns safely to avoid future incidents like that experienced
at Sandy Hook school.
Document Page
OPERATIONS MANAGEMENT
12
References
Benton, A., Hancock, B., Coppersmith, G., Ayers, J. W., & Dredze, M. (2016). After Sandy
Hook Elementary: A year in the gun control debate on Twitter. arXiv preprint
arXiv:1610.02060.
Davidov, D., Tsur, O., & Rappoport, A. (2010, August). Enhanced sentiment learning using
twitter hashtags and smileys. In Proceedings of the 23rd international conference on
computational linguistics: posters (pp. 241-249). Association for Computational
Linguistics.
Kleck, G., Gertz, M., & Bratton, J. (2009). Why do people support gun control? Alternative
explanations of support for handgun bans. Journal of Criminal Justice, 37(5), 496-
504.
O’Brien, K., Forrest, W., Lynott, D., & Daly, M. (2013). Racism, gun ownership and gun
control: Biased attitudes in US whites may influence policy decisions. PloS
one, 8(10), e77552.
Saif, H., He, Y., & Alani, H. (2012, November). Semantic sentiment analysis of twitter.
In International semantic web conference (pp. 508-524). Springer, Berlin, Heidelberg.
Stefanone, M. A., Saxton, G. D., Egnoto, M. J., Wei, W., & Fu, Y. (2015, January). Image
attributes and diffusion via twitter: The case of# guncontrol. In System Sciences
(HICSS), 2015 48th Hawaii International Conference on (pp. 1788-1797). IEEE.
Vizzard, W. J. (2014). The current and future state of gun policy in the United States. J.
Crim. L. & Criminology, 104, 879.
Document Page
OPERATIONS MANAGEMENT
13
Wang, N., Varghese, B., & Donnelly, P. D. (2016). A Machine Learning Analysis of Twitter
Sentiment to the Sandy Hook Shootings.
1 out of 13
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

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

Available 24*7 on WhatsApp / Email

[object Object]