Sentiment-Analysis
Sentiment-Analysis copied to clipboard
Twitter Sentiment Analysis
Sentiment-Analysis
Twitter Sentiment Analysis with Tensorflow.js
Connect to Twitter API, gather tweets by hashtag, compute the sentiment of each tweet, and build a real-time dashboard to show the result.
Live Demo
https://bensonruan.com/twitter-sentiment-analysis-with-tensorflowjs
Installing
- Clone this repository to your local computer
git https://github.com/bensonruan/Sentiment-Analysis.git
- On Twitter developer platform https://developer.twitter.com/
- Register a Twitter dev account
- Create a Twitter App
- Get the Consumer API keys and Access tokens
- Replace your API keys in queryTwitter.php
- Config your path to the queryTwitter.php inside sentiment-analysis.js and sentiment-analysis-bundle.js
queryTwitter: window.location.protocol + '//'+ window.location.hostname + '/js/sentiment/queryTwitter.php?q='
- Point your localhost to the cloned root directory. Browse to http://localhost/index.html
Note
If you are on Windows, you would need to install PHP via Web Platform Installer
Library
- twitter-api-php - PHP Wrapper for Twitter API v1.1 calls
- jquery - JQuery
- tensorflow.js sentiment - Perform text sentiment analysis on text using the Layers API of TensorFlow.js
- canvasjs - JQuery chart library