Search our Blogs
Showing results for 
Search instead for 
Do you mean 

Our Feelings About Politicians - An analytics dashboard of real-time public sentiment on Twitter

Link to the app


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 toScreen Shot 2016-03-23 at 10.46.47 AM.png 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, 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.


  1. Fork it (must be signed into Github)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. 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.


efroselli Level 4
| ‎06-16-2016 08:58

Really exciting project, but the link to the website just gives me a black page, and a message about how only secure content is displayed. Is the site down or is there a problem accessing it from the UK?

Developer Evangelist
| ‎06-16-2016 09:41

The app currently does not support IE. Try using Google Chrome :)

efroselli Level 4
| ‎06-16-2016 09:46

Yes! That works. Very cool and very topical!

efroselli Level 4
‎06-16-2016 09:48 - edited ‎06-16-2016 10:03

The thing I would suggest to add is Like and Share buttons for social media, as it's too good not to put it about!

I see the links top of THIS page, but what if people access the website directly without passing through here.

efroselli Level 4
| ‎06-16-2016 09:53

Question though - if Instantaneous Public Sentiment is from 0 to 100, how can Bernie be at -11?

Developer Evangelist
| ‎06-16-2016 10:48

Great suggestion!


The reason he is at -11 is because we mapped the score from the output of sentiment analysis API to a range that has a bit more resolution on these graphs. In a short time, he will go back within range.

efroselli Level 4
| ‎06-17-2016 01:51

Another suggestion, from the perspective of graphic readability, would be to have the graphs in the same order as the name keys. For example, under Number of Tweets Today, the graphs show Positive, Negative and Neutral, while the key is listed Neutral, Negative and Positive. The candidates are also in reverse order between the graphs and name keys, so you have to twist your mind around to read them.

(Wish I could code as I would be able to help rather than just whine. Perhaps when I grow up...)

efroselli Level 4
| ‎07-26-2016 09:23

I can't get it to open today. It says:

An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details.


This in Chrome. Is something down?

efroselli Level 4
| ‎07-26-2016 09:24

I can't get it to open today. It says:

An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details.


This in Chrome. Is something down?

Or has it crashed with fallout from the Conventions! ;+>

Social Media
About the Author
† The opinions expressed above are the personal opinions of the authors, not of HPE. By using this site, you accept the Terms of Use and Rules of Participation