WhatsApp Chat Analysis
Upload a WhatsApp export and get stats, timelines, sentiment, topics and toxicity. It handles Hinglish chats too.
Overview
This started as a course project and I kept adding things. You upload an exported chat (Android and iPhone exports use different formats, and the parser handles both) and it shows activity stats, timelines, heatmaps, a word cloud with Hinglish stopwords removed, and emoji usage. Then the ML parts: sentiment, LDA topics, toxicity with Toxic-BERT, and a reply graph that shows who talks to whom.
Problem
Indian group chats are mostly Hinglish, and most sentiment models are trained on English tweets. That mismatch was the interesting part.
Approach
I trained Logistic Regression and LinearSVC on Sentiment140 (TF-IDF), and also added multilingual BERT. Messages that aren't in English get translated with deep-translator. On top of that there's a small hand-made Hinglish slang list that overrides the model for strong words it would otherwise get wrong.
Architecture / how it works
- Sentiment: LogReg / LinearSVC (TF-IDF, Sentiment140) plus
nlptown/bert-base-multilingual-uncased-sentiment, with a Hinglish slang override. - Topics with gensim LDA, toxicity with
unitary/toxic-bert. - Reply network with NetworkX, drawn interactively with PyVis.
- Hinglish stopword list for the word cloud, and deep-translator for non-English messages.
- pytest tests and a Dockerfile.
Tech stack
Outcomes
Test accuracy on Sentiment140: Logistic Regression 76.78% (trained on a 1M-tweet sample), LinearSVC 73.79% (trained on 50k; it overfits at 80.95% on train). On real Hinglish chats it's worse than that, because chat messages look nothing like tweets. I wrote that limitation into the README instead of hiding it.
Gallery

