MustafaMarwat / Amazon-Food-Review-Sentiment-Analysis-ML

This repository hosts Python code for a sentiment analysis of Amazon customer reviews. The project assesses the impact of various features on classifier performance and classifies reviews as positive or negative based on adjusted ratings. Explore and experiment with the classifiers to optimize results and use Matplotlib for visualization.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sentiment Analysis of Amazon Customer's Reviews for Food Products Using Machine Learning Approach

This repository contains Python code for a project that focuses on sentiment analysis of product reviews. The project implements and compares three types of linear classifiers: the perceptron algorithm, the average perceptron algorithm, and the Pegasos algorithm. It uses a dataset of product reviews from Amazon customers and explores the impact of different features on classifier performance. The reviews, originally given on a 5-point scale, have been adjusted to a +1 or -1 scale, representing a positive or negative review, respectively.

Project Overview

  • Objective: Develop a sentiment analysis classifier for product reviews.
  • Dataset: Reviews written by Amazon customers for various food products.
  • Classification Task: Given a review, classify it as positive (+1) or negative (-1).

Project Structure

  • project1.py: Implementation of learning algorithms and hinge loss functions.
  • main.py: Script for running experiments using the implemented classifiers.
  • utils.py: Utility functions provided by the project staff.
  • test.py: Script to run tests on the implemented methods.
  • data/: Folder containing the dataset in .tsv format.
  • stopwords.txt: List of stopwords for text preprocessing.
  • README.md: This README file.

Setup

  • Python version: 3.8
  • Required libraries: NumPy, Matplotlib

Usage

  1. Clone this repository to your local machine:
    git clone https://github.com/your-username/Sentiment-Analysis-of-Amazon-Customers-Reviews-for-Food-Products-Using-Machine-Learning-Approach.git
    

Results

Experiment with different features and hyperparameters to achieve the best classifier performance. You can visualize and analyze the results using Matplotlib in main.py.

Contributing

Contributions are welcome! If you find any issues or have improvements to suggest, please open an issue or submit a pull request.

Acknowledgements

This project is part of the Machine Learning with Python course at MITx.

About

This repository hosts Python code for a sentiment analysis of Amazon customer reviews. The project assesses the impact of various features on classifier performance and classifies reviews as positive or negative based on adjusted ratings. Explore and experiment with the classifiers to optimize results and use Matplotlib for visualization.


Languages

Language:Python 100.0%