The 2016 presidential election is arguably the most divided, opinion filled - and interesting - one in years with candidates campaigning and advocating for polar opposite sides of the political spectrum, some even challenging their respective party’s core beliefs causing backlash from the establishment. The media’s biasm when recounting debates, speeches, and so called scandals prove it difficult to obtain objective facts on political issues and candidates, which is quintessential when deciding who should lead the free world starting in 2017.
We thought it would be interesting to try and see what the public is thinking about this. Using our Sentiment Analysis API, we’re making sense of the chaos of information on Twitter by quantifying public opinion about each of the particular candidates in real-time. When someone tweets about or to a candidate, this tweet’s sentiment is analyzed, mapped from 0 to 100 (0 to 49 is negative, 50 is neutral, and 51 to 100 is positive) and factored into a running average for the day and also into a smoothed, instantaneous sentiment. The total number of tweets for the day for each candidate broken down by negative, neutral, positive, and total, are tracked giving insights on which candidates attract the most public attention for whatever the reasons. This data is displayed on bar graphs which show how candidates compare to one another on each of these metrics. All of this information is then saved and added to a Haven OnDemand index, allowing search of pertinent, past public perception of particular candidates. Each candidate also has their bio, link to their Wikipedia page, and the most recent news articles about them, obtained using our Query Text Index API for public news sites.
Stack and libraries
The app is written in Node.js, using socket.io, and Grommet, an HPE library of React.js, and using Twitter to stream the tweets about each of the candidates and Haven OnDemand’s Sentiment Analysis API to analyze the tweets. You can find the website here and the source code here on Github.
Contribute to this open source project!
We're continually looking to update this dashboard with powerful insights extracted from rich data and metrics. We strongly encourage developers to fork the source code and submit a pull request with new features to help grow our understanding of how the American public feels and reacts to our political campaigns.
- Fork it (must be signed into Github)
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
We encourage developers to add to this as they see fit. Here is what we think would be neat additions to this dashboard:
- Historical, searchable graphs (line, bar, or chart) of the information presented on this dashboard.
- How each of the candidates stand on particular issues.
- Each of the candidates plans once in office (taxes, military, etc).
- Each of the candidate's most recent tweets.
- The capability for an admin account where they can change which hashtags, users, and topics to monitor through the UI.
- Use Haven OnDemand's Concept Extraction API and Entity Extraction API to create a tag (word) cloud for each candidate.
- Save the topics and associated sentiment score from each tweet analyzed to determine an aggregate sentiment score for each topic. From this data, create a visualization to show the most negative and most positive topics related to each candidate.
You must be a registered user to add a comment here. If you've already registered, please log in. If you haven't registered yet, please click login and create a new account.