To assess user sentiment across Twitter hashtags and phrases, utilise this online application. It was developed using the React and Django frameworks, and it makes use of an LSTM model that was trained on the Kaggle Sentiment140 dataset and used as a REST API by the ReactJS front end.
Using tweepy and Keras, the service retrieves tweets and conducts inference. Additionally, based on the hashtag chosen to display a brief explanation, data is retrieved from the Wikipedia API. I included a few instances of the tweets and their anticipated attitudes as part of the research. You may find a kernel for a different sentiment categorization utilising a CNN + 1D pooling here.
-
Download the trained model and put into the
server/mainfolder
(Note: This is the CNN model. If you want use the LSTM model, you'll need to follow the training steps below and put the saved model inserver/main. Also, don't forget to change the loaded model name inserver/main/__init__.py) -
Obtain Twitter API credentials through Keys and Tokens tab under the Twitter Developer Portal Projects & Apps page and add them to the
/server/main/config.pyfile.
(Note: Please obtain an "Elevated" account because this tweepy auth operates on Twitter API v1.1 endpoint. Standard Developer account forbids these calls) -
Run
docker-compose up --buildin the terminal from the root folder
(Note: Ensure that you have Docker installed)
- Open
http://localhost:3000in your browser to access the app
(Note: The LSTM model takes long to train due to its sequential nature, and offer relatively similar performance)
- Download the Kaggle Sentiment140 dataset and put it in the root folder as
sentiment140.csv. - Run the code blocks given in the
training.ipynb



