Skip to content

Balaji-Analytics/Amazon-Sentiment-Analysis

Repository files navigation

Amazon Customer Review Sentiment Analysis

Project Overview

This project analyzes Amazon customer reviews using Natural Language Processing (NLP) techniques in Python. The goal is to identify whether customer reviews express positive, negative, or neutral sentiment and to compare customer ratings with the sentiment detected from review text.

The project uses real-world Amazon review data and demonstrates data analysis, text processing, sentiment classification, and data visualization techniques.


Objectives

  • Analyze customer reviews automatically.
  • Classify reviews into Positive, Negative, and Neutral categories.
  • Understand customer sentiment from textual feedback.
  • Compare customer ratings with review sentiment.
  • Generate visual insights from customer review data.

Dataset Information

The dataset contains Amazon customer reviews collected from real users.

Features Used

  • Reviewer Name
  • Country
  • Rating
  • Review Title
  • Review Text
  • Date of Experience

Dataset Size

  • Total Dataset Available: 21,000+ Reviews
  • Reviews Analyzed in this Project: 100

Technologies Used

Programming Language

  • Python

Libraries

  • Pandas
  • TextBlob
  • Matplotlib

Project Workflow

Step 1: Data Loading

The Amazon review dataset was loaded into Python using the Pandas library.

Step 2: Data Preparation

Review text data was extracted and prepared for sentiment analysis.

Step 3: Sentiment Analysis

TextBlob was used to calculate sentiment polarity for each review.

Classification Rules

  • Polarity > 0 → Positive
  • Polarity < 0 → Negative
  • Polarity = 0 → Neutral

Step 4: Sentiment Classification

Each review was classified into one of the following categories:

  • Positive
  • Negative
  • Neutral

Step 5: Sentiment Summary

The number of reviews in each category was calculated.

Step 6: Rating vs Sentiment Analysis

Customer ratings were compared with detected sentiment to identify patterns and inconsistencies.

Step 7: Data Visualization

A Rating vs Sentiment chart was generated to visualize the relationship between customer ratings and review sentiment.


Results

Sentiment Distribution

Sentiment Count
Negative 52
Positive 44
Neutral 4

Rating vs Sentiment

Rating Negative Neutral Positive
Rated 1 out of 5 stars 47 3 31
Rated 2 out of 5 stars 4 1 1
Rated 3 out of 5 stars 1 0 1
Rated 4 out of 5 stars 0 0 2
Rated 5 out of 5 stars 0 0 9

Key Findings

Finding 1

Negative reviews slightly outnumbered positive reviews in the analyzed sample.

Finding 2

Most 4-star and 5-star reviews were correctly identified as positive.

Finding 3

Some 1-star reviews were classified as positive because the review text contained positive words even though the overall customer rating was poor.

Finding 4

Text-based sentiment analysis does not always perfectly align with customer ratings.


Files Included

  • Amazon_Reviews.csv
  • amazon_test.py
  • amazon_sentiment_results.csv
  • rating_vs_sentiment.png

Future Improvements

  • Analyze the complete dataset of 21,000+ reviews.
  • Use advanced NLP models for higher accuracy.
  • Create additional visualizations.
  • Build an interactive dashboard.
  • Develop a web-based sentiment analysis application.

Conclusion

This project successfully analyzed Amazon customer reviews using Python and NLP techniques. Reviews were classified into positive, negative, and neutral categories, and meaningful insights were generated by comparing customer ratings with review sentiment.

The project demonstrates practical skills in data analysis, sentiment analysis, text processing, and data visualization using real-world data.


Author

Balaji Nadar

AI & Data Science Intern

Skills Demonstrated:

  • Python
  • Pandas
  • TextBlob
  • Matplotlib
  • Sentiment Analysis
  • Natural Language Processing (NLP)
  • Data Analysis

Visualization

Rating vs Sentiment

  • Data Visualization

About

Amazon Customer Review Sentiment Analysis using Python, Pandas, TextBlob and Matplotlib.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages