Skip to content

A Sentiment Prediction model trained on the sentiment140 dataset

License

Notifications You must be signed in to change notification settings

fractal2k/Twitter-Sentiment-Prediction

Repository files navigation

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.

About

A Sentiment Prediction model trained on the sentiment140 dataset

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published