/Twitter-Sentiment-Prediction

A Sentiment Prediction model trained on the sentiment140 dataset

Primary LanguageJupyter NotebookMIT LicenseMIT

Twitter Sentiment Prediction

A simple sentiment prediction model trained using the sentiment140 dataset.

Software Requirements:

How to use:

  1. Download the config.pickle, twitter_sentiment_state_dict.pt and sentiment.py files. Make sure the other two files are in the same directory as sentiment.py.
  2. Import the sentiment.py script in your program.
  3. Make an object of SentimentPredictor and call the predict() function on it.

For Example:

predictor = SentimentPredictor()
sentiment = predictor.predict('@AndrewYNg I love you, no homo')

This returns a float in the range (0, 1), 0 being negative sentiment and 1 being positive.