As the influence of the news continues to rise, we really wanted to focus on creating a tool that connects islamophobic hate speech to news headlines. We thought that if a user could visualize hotspots of islamophobic sentiment, they would be able to draw insights on islamophobic trends by region. Or perhaps organizations could further investigate where to invest resources for education and political action, or prevent violent gatherings before they take place.
What it does
This website seeks to display location-based analysis on Tweets that present islamophobic call-to-action or hate speech. It displays heatmaps of both the world and the US that users may interact with to identify how many islamophobic tweets were posted within the last week at any location. Upon clicking on a location, the user may see a time series on number of tweets per day over the last week, and view what news headlines were most popular on a given day. Here the user may analyze rhetoric used in different headlines and news articles and how that may influence hate speech on social media.
How we built it
First, we used the Twitter API to get data from tweets containing the keywords “ban islamophobia” in the past week. This includes the screen name, date tweeted, location, and tweet content. We then used the location given by twitter to reverse geocode the coordinates, country, and state. For US tweets, we were also able to calculate the FIPS county code to figure out which county the tweet was from. Using this data, we then proceeded to organize its presentation on our website. This was created using the Dash framework, which allows for quick and seamless integration with the Plotly library. We were able to use Plotly choropleth maps to create heatmaps of both the world and US, and use various bootstrap components to organize the content. When a user clicks on a specific time, a query is made to NewsAPI to extract the associated headlines.
Challenges we ran into
Key challenges involved gaining access to the Twitter API and extracting data with Twitter’s rate limitations. Obtaining the dataset took a significant portion of our time as we first had to submit an application to gain developer access to Twitter’s API and wait to get approved. Furthermore, the Twitter API only allows access to tweets up to one week old, preventing our ability to gain further insights. We also had to convert the user locations into a format that would be workable in terms of developing choropleth graphs, as the locations provided on Twitter were not in a readily plottable format.
Accomplishments that we're proud of
We are proud of our ability to pick up Dash and Bootstrap frameworks in a limited amount of time. We are also proud of our ability to draw creative connections and hypotheses between hate speech and media.
What we learned
We learned how to extract tweet data from the TwitterAPI (accessed through the Python Tweepy library) in order to create our original dataset. After obtaining the data, we used various python libraries such as reverse geocoder to convert user locations to coordinates and subsequently to ISO and FIPS codes. We were also able to leverage our existing knowledge of Plotly charts to learn how to organize these visualizations and create a dashboard in Dash. Aside from just the tools and technology used, we were able to learn more about islamophobia and the spread of hate speech by geographic location, as well as make some exploratory insights into how news headlines can impact the frequency of islamophobic hate speech.
What's next for Tracking Islamophobia
Due to Twitter rate limitation and api restrictions, we were only able to obtain a limited amount of data. A key next step would be to collect a larger dataset and use more keywords that indicate islamophobic hate speech in our tweet query. This would also allow us to create a more robust visual with more data to glean insights off of. We would also like to explore the dynamic load of current tweets to conduct an ongoing dashboard of national and international sentiments, rather than a static site. This dashboard would contain information such as number of new islamobphobic tweets, current active users engaging in islamophobic speech, and most popular users.
With these refinements, this application may serve various purposes for different groups. For example, law enforcement can use the location map to identify hotpots for islamophobic speech and detect hate groups or potential violent gatherings before they occur. Political organizations or action committees may leverage the location data to identify where to best invest their resources and time to combat islamophobia and impact legislation. Finally, the average user may use this application to stay informed about hate speech and the prevalence of islamophobic sentiment in different locations, as well as how media representation of Muslim individuals and the community at large impacts negative speech on social media.