Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Twitter Sentiment Analysis

Preview

Landing Screen

Results

Tweets

Description

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.

Process Flow

Installation

Setup

  1. Download the trained model and put into the server/main folder
    (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 in server/main. Also, don't forget to change the loaded model name in server/main/__init__.py )

  2. 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.py file.
    (Note: Please obtain an "Elevated" account because this tweepy auth operates on Twitter API v1.1 endpoint. Standard Developer account forbids these calls)

  3. Run docker-compose up --build in the terminal from the root folder
    (Note: Ensure that you have Docker installed)

Run

  1. Open http://localhost:3000 in your browser to access the app

Training

(Note: The LSTM model takes long to train due to its sequential nature, and offer relatively similar performance)

LSTM Model

  1. Download the Kaggle Sentiment140 dataset and put it in the root folder as sentiment140.csv.
  2. Run the code blocks given in the training.ipynb

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages