sentimentLens / README.md
aaditya200's picture
SentimentLens fresh
df20aff
|
Raw
History Blame Contribute Delete
1.43 kB
metadata
title: SentimentLens
emoji: 🧠
colorFrom: indigo
colorTo: purple
sdk: docker
app_file: app.py
pinned: false

🧠 SentimentLens β€” TF-IDF vs Fine-tuned DistilBERT

NLP research project: Systematically comparing classical ML against transformer models on Amazon product reviews, with failure analysis.

Built for: Amazon ML Summer School Application
Stack: Python Β· FastAPI Β· HuggingFace Transformers Β· Scikit-learn Β· React Β· Vite


πŸ“Š Results

Model Accuracy F1 Score
TF-IDF + Logistic Regression 89.35% 0.90
Fine-tuned DistilBERT 91.70% 0.92

πŸ” Key Research Finding

Mixed-opinion reviews remain unsolvable under binary classification.
Both models perform at ~45% accuracy on reviews containing both positive and negative aspects β€” suggesting binary sentiment labels are fundamentally insufficient for nuanced text.

Error Analysis by Category

Category TF-IDF Error BERT Error
Negation 5.1% 20.4%
Mixed Opinion 11.9% 54.9%
Very Long 9.6% 48.9%
Normal 10.5% 51.1%

πŸš€ Quick Start

1. Train the model

cd backend
pip install -r requirements.txt
python train.py