Twitter Bot Classification

Telling genuine public reaction apart from likely-bot activity in political discourse.

Department
Information Science
Role
Head Researcher
Year
2025

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:

  1. Scrape: about 440 tweets tagged #Trump or #Kamala, January to November 2024, collected with PhantomBuster because the free Twitter API was no longer available.
  2. Clean: keep English, on-topic tweets, which left about 300.
  3. Classify: Botometer bot-likelihood scoring for each account, split into three tiers: likely human, ambiguous and likely bot.
  4. Score: sentiment with both VADER and TextBlob.
  5. Test: t-tests on sentiment between the three tiers, for each candidate.
  6. Code: inductive coding of tweet content into 11 themes, compared across tiers.
~300 tweets in 3 bot-likelihood tiers (Botometer) QUANTITATIVE Sentiment scores VADER and TextBlob t-tests no tier differed (p > 0.4) QUALITATIVE Inductive coding 11 themes Disapproval of Trump: mostly likely humans Partisan support: none from bot-leaning accounts FINDING Bot sentiment blends in with human sentiment Next: a larger, cleaner dataset ~300 tweets in 3 bot-likelihood tiers (Botometer) QUANTITATIVE Sentiment VADER, TextBlob QUALITATIVE Coding inductive, 11 themes t-tests no tier differed (all p > 0.4) Disapproval of Trump: mostly likely humans Partisan support: none from bot-leaning FINDING Bot sentiment blends in with human sentiment Next: a larger, cleaner dataset
Statistics alone found no difference; the coding showed where bots and humans still diverged.

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.

Tweets about Kamala Harris t-tests p = 0.51 to 0.73 Likely human Ambiguous Likely bot Tweets about Donald Trump t-tests p = 0.41 to 0.66 Likely human Ambiguous Likely bot -1-0.500.51 Mean sentiment score (dot) and 1 standard deviation (bar) Tweets about Kamala Harris t-tests p = 0.51 to 0.73 Likely human Ambiguous Likely bot Tweets about Donald Trump t-tests p = 0.41 to 0.66 Likely human Ambiguous Likely bot -1-0.500.51 Mean sentiment (dot), 1 standard deviation (bar)
The spreads overlap so much that none of the differences between tiers were statistically significant.

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.

Tools

  • Python
  • PhantomBuster
  • Botometer
  • VADER
  • TextBlob
  • SciPy
  • Inductive coding