Skip to content

A deep learning model (Bidirectional LSTM) using pretrained word embeddings to do sentiment analysis on Amazon fine food reviews dataset.

License

Notifications You must be signed in to change notification settings

ngoquanghuy99/Sentiment-classification-of-Amazon-fine-food-reviews

Repository files navigation

Sentiment classification of Amazon fine food reviews

A sentiment analysis implementation on the Amazon fine food reviews dataset.

Overview

In this implementation, i used pretrained word embeddings GloVe 100d as the input of my deep learning model using Bidirectional LSTM.

Created by Ngo Quang Huy @ngoquanghuy99

Email: ngoquanghuy1999lp@gmail.com

Results on testing set

Download model

label precision recall f1-score support
0 0.79 0.73 0.76 11394
1 0.95 0.96 0.96 61388
accuracy 0.93 72782

Getting started

Install dependencies

Requirements

  • tensorflow>=2.3.1

  • keras>=2.4.3

    $ pip3 install -r requirements.txt
    

Training

$ python train.py

Accuracy graph:

Loss graph:

Fine tuning model by changing hyperparameters in config.py

Testing

On the assumption that you want to predict directly

$ python test.py --review "this is the worst thing i\'ve ever bought"

Output:

$ 'this is the worst thing i've ever bought' is NEGATIVE 82.63011127710342%

About

A deep learning model (Bidirectional LSTM) using pretrained word embeddings to do sentiment analysis on Amazon fine food reviews dataset.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages