NLP · Web scraping · Classification

Customer Review Sentiment Analysis

An NLP pipeline that scrapes product reviews, cleans the text and classifies sentiment, so negative feedback surfaces automatically instead of being buried in thousands of reviews.

End-to-end project

The problem

Product and marketing teams receive thousands of reviews and can't read them all. They need to know which products get negative feedback, quickly enough to act.

The data

2,318 scraped e-commerce reviews across five categories, reduced to 1,468 unique reviews after removing duplicates and empty text.

Approach

  1. Scraping

    requests + BeautifulSoup across shoes, skincare, gadgets and fitness categories.

  2. Text cleaning

    Lower-casing, punctuation and stop-word removal, tokenisation and lemmatisation with NLTK.

  3. Labelling

    No human labels existed, so sentiment was labelled with VADER and cross-checked with TextBlob.

  4. Modelling

    TF-IDF features, SMOTE on training data only; Logistic Regression, Naive Bayes, trees, boosting, LSTM and GRU compared.

  5. Deployment

    A Streamlit app that classifies any review a user types.

What I found

Results (test set: 213 reviews)
ModelAccuracyNegative-class F1Macro F1
Logistic Regression (TF-IDF)0.960.870.92
Random Forest0.950.860.92
Naive Bayes0.940.840.90
Decision Tree0.900.760.85

The key insight

At this data size, the simple, explainable model is the right choice, and the right metric is the one that measures what the business needs to catch: negative reviews.

Limitations & next steps

Tools