Back to Work
Sentiment Analysis
AI / ML

Sentiment Analysis

Comparative sentiment-analysis study on the Amazon Fine Food Reviews dataset, benchmarking lexicon-based VADER against transformer-based RoBERTa to quantify how context-aware models improve classification.

2024
PythonHugging FaceRoBERTaNLTKpandasseaborn

Overview

A comparative analysis of sentiment analysis techniques on the Amazon Fine Food Reviews dataset. Implements two distinct approaches: VADER (a lexicon-based method) and RoBERTa (a transformer-based deep learning model). The project contrasts a Bag of Words approach against context-aware neural models to demonstrate how linguistic understanding affects sentiment classification accuracy on real-world review data.

Problem Statement & Approach

Lexicon-based sentiment scoring is fast and interpretable but blind to context, while transformer models capture nuance at higher cost — it isn't obvious how much that nuance actually buys on real review data.

Approach: Benchmark the two head-to-head on the Amazon Fine Food Reviews dataset: VADER as a bag-of-words lexicon baseline against RoBERTa as a context-aware transformer, comparing where each agrees, disagrees, and fails.

System Architecture

Load and preprocess the Amazon Fine Food Reviews, score each review with both VADER (NLTK) and RoBERTa (Hugging Face), then align and visualize the two sets of scores to analyze agreement and divergence.

Key Features

  • Analyzes the Amazon Fine Food Reviews dataset
  • Lexicon-based VADER sentiment scoring
  • Transformer-based RoBERTa classification via Hugging Face
  • Contrasts Bag-of-Words against context-aware neural models
  • Evaluation and visualization with pandas and seaborn

Technical Stack

Language

Python

NLP

NLTKVADERHugging Face TransformersRoBERTa

Data & Viz

pandasseaborn

Challenges & Solutions

Challenge: VADER and RoBERTa disagree most on sarcasm and mixed-sentiment reviews.

Solution: Aligning both scores per review surfaced exactly where lexicon methods break down and context-aware models add value.

Improvements

  • Add a fine-tuned domain-specific model to the comparison
  • Aspect-based sentiment to score individual product attributes
NLPSentiment AnalysisTransformersVADER