Problem
Organizations that use social sentiment data need to distinguish genuine public reaction from activity associated with likely-bot accounts.
Approach
I built an end-to-end Python workflow that pairs sentiment statistics with qualitative coding:
- Scrape: about 440 tweets tagged #Trump or #Kamala, January to November 2024, collected with PhantomBuster because the free Twitter API was no longer available.
- Clean: keep English, on-topic tweets, which left about 300.
- Classify: Botometer bot-likelihood scoring for each account, split into three tiers: likely human, ambiguous and likely bot.
- Score: sentiment with both VADER and TextBlob.
- Test: t-tests on sentiment between the three tiers, for each candidate.
- Code: inductive coding of tweet content into 11 themes, compared across tiers.
Result
Sentiment from likely-bot accounts was statistically indistinguishable from likely-human sentiment: no t-test between tiers was significant (all p > 0.4). Every tier’s spread overlaps the others.
The qualitative coding showed where the groups still differed. Most tweets disapproving of Trump came from likely-human accounts, and partisan support disappeared among bot-leaning accounts, though that may be a sample-size effect.
The main limitation is the dataset. Scraping limits meant about 440 tweets shrank to about 300 after cleaning, which reduces statistical power. The next step is to repeat the method on a larger, better-cleaned dataset.
Where else it applies
The workflow generalizes to brand-sentiment monitoring, review-authenticity analysis and public-opinion research.