Skip to content

This project classifies Amazon Food comments into positive, neutral, or negative sentiments. It employs two methods: a Bag-of-Words approach using VADER and transformers encoder-decoder approach using T5.

MayssaJaz/Sentiment-Analysis-Amazon-Food-Reviews

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentiment Analysis for Amazon Food Reviews

This project focuses on sentiment analysis for Amazon Food comments, categorizing them into positive, neutral, or negative sentiments. Two distinct models have been employed for this purpose:

Models:

1. VADER Bag-Of-Words Approach

The first approach utilizes the VADER sentiment analysis tool in conjunction with a Bag-Of-Words methodology. This approach provides a baseline for sentiment classification based on lexicon and rule-based analysis.

2. T5 Transformers Model Approach

The second approach involves the use of the Text-to-Text (T5) transformer model. We fine-tuned it on sentiment analysis task on Amazon Food comments. This approach leverages the power of transformer-based architectures for contextual understanding and captures more complex relationships within the data compared to the Bag-Of-Words.

Microservice integration:

This project integrates the fine-tuned T5 (Text-To-Text Transfer Transformer) model for sentiment analysis. The purpose is to analyze user-provided text, typically reviews, and classify them as positive, negative or neutral. The system is implemented using FastAPI for the backend and ReactJS for the frontend to provide a user-friendly interface for predicting sentiments.

1. Setup:

  1. Environment Configuration:

    Create an .env file inside the back directory and specify the following variables:

    EXTRACTED_MODEL_PATH=/path/to/extracted/model
    MODEL_NAME="t5-base"

    Replace /path/to/extracted/model with the actual path where the fine-tuned T5 model is stored.

  2. Launch application:

    In the project root directory, where the docker-compose.yml file is located, run the following command:

      docker-compose up --build

    This command will build and start the Docker containers for both the FastAPI backend and ReactJS frontend.

  3. Access the Application:

    Open your web browser and go to http://localhost:3000 to access the ReactJS frontend.

2. Results:

1. Positive Sentiment:

Positive Result

2. Negative Sentiment:

Negative Result

3. Neutral Sentiment:

Neutral Result

About

This project classifies Amazon Food comments into positive, neutral, or negative sentiments. It employs two methods: a Bag-of-Words approach using VADER and transformers encoder-decoder approach using T5.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published