Skip to content

fork52/Sentiment-Analyzer

Repository files navigation

Review Sentiment Analyzer

Fine grained sentiment analysis on App Reviews with deep learning.

MIT License python usage Code size

Description

The repository is dedicated to performing Fine Grained Sentiment Analysis on text into five polarity classes using deep learning models in Python. A subset of the Amazon Product Data for Android Apps has been used for training the various models.

The sentiment class labels are:

  • 0 - Extremely negative (1 star)
  • 1 - Negative (2 star)
  • 2 - Neutral (3 star)
  • 3 - Postive (4 star)
  • 4 - Extremely positive (5 star)

Visualization Demo

You can test the models with your own sentences by running the demo.py file. The GUI has been with Python's inbuilt tkinter module.

Also, do checkout the Notebook which I used for training.

Enjoy playing around with the embedding visualization:

Dependencies

  1. tensorflow : TensorFlow is an end-to-end open source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries and community resources that lets researchers push the state-of-the-art in ML and developers easily build and deploy ML powered applications.

  2. Python Imaging Library : Pillow is the friendly PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lundh and Contributors.

  3. numpy : The fundamental package for scientific computing with Python.

Using the models

From model_utils.py, import one of the four classes:

  1. FullyConnected_NN
  2. BiRNN
  3. GRU
  4. BiLSTM
>>> from model_utils import GRU
>>> obj = GRU()
>>> sentence = 'This app is extremely amazing!'
>>> obj.get_rating(sentence)
5

Note that the object creation might take 3-5 seconds to since the model is slightly large. BiLSTM will give the best performance.

Future Work

Will try to build better models which can provide better performance and commit the changes.

Credits

  1. Have been working on this project whilst completing this amazing specialization Tensorflow in Practice on Coursera. A few code snippets and ideas I have used for training are directly inspired from the content in the course.

  2. As mentioned earlier, the dataset I have used for training is a subset from the Amazon product data for Android apps.

License

The repository is licensed under MIT License.

Contributing

  1. Fork it (https://github.com/fork52/Sentiment-Analyzer/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request