Methodology

How the numbers are made

A plain-English walkthrough of our data pipeline, from raw posts to the scores you see on every rankings, county and issue page. For the formal legal version, see our Sentiment Attribution & Methodology document.

1. Data collection

We continuously scrape 9 sources — Nation, Standard, Tuko, The Star, Citizen TV, Twitter/X, YouTube, Facebook and a curated set of political blogs — on a 15-minute refresh cycle. Every post is checked for spam and deduplicated before it enters the pipeline.

2. Entity recognition & sentiment scoring

Each post is scanned for mentions of tracked politicians, using name and alias matching to handle nicknames and spelling variants (so "Ruto", "William Ruto" and common Sheng nicknames all resolve to the same politician). Every mention is then scored by an XLM-RoBERTa multilingual transformer model, fine-tuned to read English, Swahili and Sheng natively rather than relying on machine translation. Scores range from −1.0 (very negative) to +1.0 (very positive).

3. Rankings & the composite score

A politician's rank isn't just their average sentiment — a politician with 5 mentions and a perfect score shouldn't outrank one covered thousands of times. We combine two signals: sentiment (the mention-weighted average score) and mention share (how much of the conversation, relative to other tracked politicians, is about them), weighted 60/40 in favour of sentiment.

We also apply a polarity confidence adjustment: when opinion is split roughly 50/50 positive and negative, we down-weight the sentiment term, so a politician who is loved by half and hated by half doesn't score the same as one who is consistently well regarded. Politicians need a minimum number of real mentions before they're ranked at all — below that threshold, we show them as tracked but flag the data as insufficient rather than force a misleading rank.

4. Geographic mapping

County, constituency and ward boundaries are matched against KNBS-verified administrative data across all 47 counties. County sentiment is a mention-weighted average of every scored post geo-tagged to that county.

Freshness and coverage trade off against each other: a county with heavy news coverage in the last 48 hours shows a genuinely live score, while a county with lighter day-to-day coverage automatically widens its lookback window — 7 days, then 30, then 90, up to the full history — until it has enough real mentions to report honestly. We'd rather show a county's real sentiment from three weeks ago than an artificial "no data" when the story is simply that few outlets covered it this week.

5. Spike detection

We monitor mention volume for every tracked politician, county and issue against its own recent baseline. A sharp, sustained jump — a scandal breaking, a major announcement, a viral moment — triggers a spike alert, surfaced on the dashboard and to anyone watching that entity.

Limitations

Sentiment models are not infallible. Sarcasm, coded political language, and fast-moving Sheng slang are genuinely hard for any NLP system, including ours — we tune continuously against Kenyan political text specifically, but scores should be read as a strong directional signal, not a certified fact. Coverage also reflects what the 9 source outlets choose to publish, which is itself not a perfectly neutral sample of public opinion.

Full technical and legal detail, including data retention and correction requests, is in our AI Systems Disclosure.