fractal2k / Twitter-Sentiment-Prediction

A Sentiment Prediction model trained on the sentiment140 dataset

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:MIT License


Languages

Language:Jupyter Notebook 98.3%Language:Python 1.7%