โ† All projects

Brand Sentiment on Social Media

How do people feel about five phone brands, and which words drive positive and negative posts?

Simulated dataText & NLPPythonNLTKTextBlobscikit-learn
10,000posts
45.5%positive
24.8%negative

The question

Brands want an early read on public opinion. This project builds the full text pipeline, from cleaning to a ranked view of how each brand is doing.

What I did

Cleaned posts by removing links, mentions, hashtags and stopwords.
Scored sentiment with TextBlob and compared it with the labels.
Trained TF-IDF models with Naive Bayes and logistic regression.
Ranked brands by net sentiment (positive share minus negative share) and tracked daily trends.

What I found

Sentiment split 45.5% positive, 29.8% neutral and 24.8% negative.
TextBlob matched the labels 88.8% of the time but caught only 69% of the negative posts.
Word clouds separate the vocabulary of positive and negative posts clearly.

Charts from the analysis

Brands ranked by net sentiment.
Brands ranked by net sentiment.
Most frequent words by sentiment.
Most frequent words by sentiment.
Daily sentiment over time.
Daily sentiment over time.

Limits to keep in mind

Simulated data

The posts are simulated from templates. Naive Bayes scored 100% on the held-out set, which tells me the text is too uniform to work as a benchmark. Real posts would score far lower.

View the code on GitHub โ†—
โ† PreviousCustomer Segmentation with RFMNext โ†’AI vs Human Text Detection