Skip to main content
QUICK REVIEW

[Paper Review] A Machine Learning Analysis of Twitter Sentiment to the Sandy Hook Shootings

Nan Wang, Blesson Varghese|arXiv (Cornell University)|Sep 2, 2016
Crime, Deviance, and Social ControlSocial Sciences25 references7 citations
TL;DR

This study applies machine learning to over 700,000 U.S. tweets from a 40-day window around the 2012 Sandy Hook shooting to classify pro-gun and anti-gun sentiments. It reveals a sustained peak in pro-gun sentiment lasting days after the event, while anti-gun sentiment rapidly declines, challenging assumptions about public reaction to mass shootings.

ABSTRACT

Gun related violence is a complex issue and accounts for a large proportion of violent incidents. In the research reported in this paper, we set out to investigate the pro-gun and anti-gun sentiments expressed on a social media platform, namely Twitter, in response to the 2012 Sandy Hook Elementary School shooting in Connecticut, USA. Machine learning techniques are applied to classify a data corpus of over 700,000 tweets. The sentiments are captured using a public sentiment score that considers the volume of tweets as well as population. A web-based interactive tool is developed to visualise the sentiments and is available at http://www.gunsontwitter.com. The key findings from this research are: (i) There are elevated rates of both pro-gun and anti-gun sentiments on the day of the shooting. Surprisingly, the pro-gun sentiment remains high for a number of days following the event but the anti-gun sentiment quickly falls to pre-event levels. (ii) There is a different public response from each state, with the highest pro-gun sentiment not coming from those with highest gun ownership levels but rather from California, Texas and New York.

Motivation & Objective

  • To analyze public sentiment on Twitter in response to the Sandy Hook school shooting using machine learning.
  • To investigate temporal and geographic patterns of pro-gun and anti-gun sentiment across U.S. states.
  • To evaluate multiple machine learning models for sentiment classification in social media data.
  • To develop an interactive web tool for visualizing sentiment trends by state, accounting for population and gun ownership levels.
  • To bridge computer science and public health by applying NLP to a critical public health issue: gun violence.

Proposed method

  • Collected historical Twitter data via GNIP, filtering for keywords, time period (40 days), and U.S. geographic location.
  • Pre-processed tweets by parsing JSON files into CSV format using R, extracting relevant text and metadata.
  • Created a gold-standard training set of 5,000 manually labeled tweets (pro-gun, anti-gun, neutral) for supervised learning.
  • Evaluated multiple machine learning algorithms—SVM, Maximum Entropy, Random Forest, Neural Networks, Naïve Bayes, and ensemble methods—on the labeled data.
  • Selected top-performing models (e.g., SVM, Random Forest) to classify the full dataset of over 700,000 tweets.
  • Visualized sentiment trends by state using a web-based tool at http://www.gunsontwitter.com, normalizing for population and gun ownership levels.

Experimental results

Research questions

  • RQ1How did pro-gun and anti-gun sentiments on Twitter change in the days immediately following the Sandy Hook shooting?
  • RQ2Which U.S. states exhibited the highest levels of pro-gun sentiment, and how do these correlate with gun ownership rates and population size?
  • RQ3Which machine learning models perform best in classifying pro-gun, anti-gun, and neutral sentiments in Twitter data?
  • RQ4Can sentiment trends on social media be reliably visualized and used to inform public health or policy timing?
  • RQ5How do public reactions to a mass school shooting differ in intensity and duration between pro-gun and anti-gun sentiment?

Key findings

  • Both pro-gun and anti-gun sentiments peaked on the day of the Sandy Hook shooting, indicating intense public discourse.
  • Anti-gun sentiment declined rapidly to pre-event levels within days, suggesting a short-lived public outcry.
  • Pro-gun sentiment remained elevated for several days after the shooting, indicating sustained support or justification of gun ownership.
  • The highest pro-gun sentiment was observed in California, Texas, and New York—states not necessarily with the highest gun ownership levels.
  • The study identified SVM and Random Forest as the most accurate models for classifying three-class sentiment (pro-gun, anti-gun, neutral) in Twitter data.
  • The interactive web tool at http://www.gunsontwitter.com successfully visualized sentiment trends by state, normalized for population and gun ownership.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.