How to build your own Twitter Sentiment Analyzer ?
-
Context
- Machine learning is an application of artificial intelligence (AI) that provides systems the ability to automatically learn and improve from experience without being explicitly programmed.
- ml5 is a beginner-friendly Javascript library that provides simple and ready-to-use encapsulation of Google's TensorFlow machine learning functions.
-
Learn about
- The ml5 website.
-
Download the ml5 examples
- Go to the Github repository.
-
Download the zip or
clone the repo.
~$ git clone https://github.com/ml5js/ml5-examples.git
-
Play around
- Look at the examples in ml5-examples/p5js.
- And online.
-
Get the sentiment analyzer
- Get it from ml5-examples/p5js/Sentiment/Sentiment_Interactive/.
- Or online.
-
Notes
-
Twitter API v1.1 requires OAuth authentication
to manipulate datasets, which is impossible to perform with a
client-side language like Javascript.
It is therefore impossible to make HTTP requests and get tweets from JSON files without using a third-party server-side language like PHP.
For further information, see Twitter for developers.
-
Twitter API v1.1 requires OAuth authentication
to manipulate datasets, which is impossible to perform with a
client-side language like Javascript.
-
Proposed alternatives
- Alternative 1: build a search bar linked with Twitter to find tweets and a text area to copy-paste them into the sentiment analyzer.
- Alternative 2: save a list of tweets in an array and create user access through interactive web design.
-
To create your own Tweet Analyzer:
- Remix this project to Glitch.
- Customize it as you want.
- Have fun.