Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Customer-Reviews-Topic-Modeling

Unsupervised topic modeling on 630,000+ English app reviews from 11 major e-commerce platforms. Five methods are applied and aggregated into a consensus topic set to identify universal themes in customer feedback.


Dataset

Source: Customer E-Commerce Reviews — Kaggle

11 apps: Alibaba, Aliexpress, Amazon, Daraz, Flipkart, Lazada, Meesho, Myntra, Shein, Snapdeal, Walmart

  • Total reviews available: 629,989
  • Sample used: 10,000 per app (110,000 total, random seed 42)
  • After preprocessing: 97,619 reviews retained

Methods

Five topic modeling approaches are applied to both a combined corpus (Mode A) and each app individually (Mode B).

Method Type Library
LDA Probabilistic generative model Gensim
NMF Matrix factorization scikit-learn
LSA SVD-based dimensionality reduction scikit-learn
BERTopic Transformer embeddings + clustering BERTopic
LDA + Bigrams LDA with bigram phrase detection Gensim

Topics are set to K=10 across all methods. Coherence score (c_v) is used to optimize and evaluate. Results from all five methods are aggregated using cosine similarity of topic-word vectors to produce a consensus topic set.


Results

Method Comparison — Combined Corpus

Method Coherence (c_v) Diversity
NMF 0.5739 0.8333
LDA + Bigrams 0.5363 0.7400
LDA 0.5288 0.7800
BERTopic 0.5189 0.8296
LSA 0.4805 0.4800

NMF achieves the highest coherence and diversity on the combined corpus and ranks first on all 11 individual apps.

Consensus Topics (all 10 confirmed HIGH CONFIDENCE)

Topic Label Methods Agreeing
0 Account and Payment Issues 3/5
1 Order Cancellation and Refunds 5/5
2 App Performance and Bugs 4/5
3 Delivery Delays 5/5
4 Search and Browse UX 5/5
5 Fashion and Sizing 4/5
6 Positive Experience 5/5
7 In-store and Inventory 4/5
8 Customer Service 5/5
9 Price and Product Quality 5/5

Per-App Coherence (average across methods)

App Avg Coherence
Flipkart 0.5001
Amazon 0.4903
Meesho 0.4885
Lazada 0.4838
Walmart 0.4730
Myntra 0.4683
Snapdeal 0.4660
Shein 0.4637
Daraz 0.4465
Aliexpress 0.4444
Alibaba 0.3394

Alibaba scores notably lower, likely due to mixed-language reviews in the dataset.


Project Structure

customer-reviews-topic-modeling/
│
├── notebook/
│   └── customer_reviews_topic_modeling.ipynb   # Full Kaggle notebook
│
├── outputs/
│   ├── evaluation_summary.csv
│   ├── consensus_topics.csv
│   ├── per_app_summary.csv
│   ├── per_app_topics.csv
│   ├── lda_topics.csv
│   ├── nmf_topics.csv
│   ├── lsa_topics.csv
│   ├── bert_topics.csv
│   ├── lda_bigram_topics.csv
│   ├── chart1_method_comparison.png
│   ├── chart2_perapp_coherence_heatmap.png
│   ├── chart3_perapp_grouped_bar.png
│   ├── chart4_consensus_confidence.png
│   ├── chart5_bertopic_distribution.png
│   └── chart6_app_topic_fingerprint.png
│
└── README.md

Setup

This project runs on Kaggle. To reproduce:

  1. Go to Kaggle and create a new notebook
  2. Add the dataset: peesarisathvikreddy/customer-e-commerce-reviews
  3. Enable GPU accelerator (T4 x2 recommended)
  4. Upload and run customer_reviews_topic_modeling.ipynb

Dependencies are installed inside the notebook. No local setup required.


Key Observations

  • NMF consistently outperforms all other methods on short e-commerce review text, likely because non-negative constraints produce more focused topic representations on sparse documents.
  • BERTopic discovers niche but actionable topics missed by bag-of-words methods: dark mode requests, wishlist bugs, app crash patterns, and localisation complaints.
  • Negative reviews are significantly more specific than positive ones. Positive topics surface generic words (nice, thank, amazing) while negative topics contain precise vocabulary (cancel, refund, fake, fraud, crash, freeze).
  • The 59.6% BERTopic outlier rate reflects the high heterogeneity of app review text, where many short reviews do not belong to any dominant theme.

Tech Stack

Python 3.12 | Gensim 4.3.3 | scikit-learn | BERTopic 0.16.0 | sentence-transformers | UMAP | HDBSCAN | spaCy | NLTK | matplotlib | seaborn

About

Multi-method topic modeling pipeline on 630K customer reviews from 11 e-commerce platforms.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages