Skip to content

RichardLiu2001/SafeTweet

Repository files navigation

SafeTweet

SafeTweet Website

A geographic heat map displaying instances of danger from police Twitter accounts.

Zoom in to a "hot" area and click a circle to see that individual Tweet, which contains instances of danger such as robberies, assaults, battery, etc. You can also search for a particular place as well as rotate the map.

Danger Identification

First, SafeTweet detects whether or not a Tweet contains a dangerous incident.

For example, these two Tweets contain a dangerous incident:

while these two Tweets do not contain danger:



To detect danger, first I queried 1000 Tweets using the Twitter API. These Tweets were hand-labelled for instances of danger and then used to train a deep learning model with Keras.

Furthermore, I used Snorkel AI weak supervision to generate labels for the model using danger keywords, keyword inflections, and Vader sentiment analysis. I chose to use weak supervision in order to clean and correlelate the Tweet data, since it is unlabelled and often messy.

Finally, the model was fine tuned with Google's BERT Natural Language Processing Transformer and achieved an accuracy of 93%.

Heatmap

Using the Twitter API, over 50,000 Tweets were queried from police departments of major cities, including @NYPDnews, @SeattlePD, @SFPD, and many more. The location of the incidents were extracted from the Tweets using the Google Geocoding API, and each Tweet was plotted at the location of the incident using the MapBox API.

The website is hosted with Google Firebase.

About

A geographic heat map displaying instances of danger from police Twitter accounts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors