Skip to content
Protocolzone Protocolzone

Data to Data · Government & Civic

Measuring public sentiment by ward, district and city

We hear about a problem in a district when it reaches the news, and by then the only options left are reactive.

This is a government & civic problem we approach through our Data to Data service line.

The problem

A government department has several channels through which citizens tell it something is wrong: complaint lines, feedback forms, survey calls, plus the coverage in newspapers and on television. Each channel is read by a different team, on a different cadence, and reported upward as a count.

What nobody has is the geography. Whether dissatisfaction is concentrated in four wards or spread evenly across a district is the difference between a targeted intervention and a general programme, and a count of complaints does not answer it.

The timing is the other problem. A locality shifting sharply over a fortnight is actionable. The same information arriving in a quarterly report is a post-mortem.

Why it’s hard

Sentiment is not a solved problem in the language people actually complain in. Real civic input arrives as code-mixed, transliterated, colloquial text full of local idiom, sarcasm and negation. Models trained on formal text handle none of that well, and accuracy claims from published benchmarks do not carry across to it.

The channel is a bias, not a pipe. Complaint volume measures propensity to complain. A ward with low complaint volume may be content or may have concluded that complaining achieves nothing, and the score alone cannot distinguish those. Any platform that reports a sentiment index without reporting what generated it will produce confident, geographically precise, wrong conclusions.

News is not citizen feedback and must not be averaged with it. One television segment can outweigh a thousand feedback forms in text volume. Source weighting has to be explicit and defensible.

Ward-level aggregation runs out of data. The smaller the geography, the more useful the insight and the fewer the records. At some point a ward’s score is one person’s bad week. Suppressing output below a data threshold is a design requirement, not a limitation to be worked around.

Distinguishing a signal from a news cycle. A sentiment drop that coincides with national coverage of an unrelated event is not a local finding. Anomaly detection has to be able to separate a locality moving from everywhere moving.

The output has political consequences. A ward-level sentiment map will be used in decisions about funding, staffing and enforcement. That places a requirement on explainability that a black-box classifier does not meet: someone will ask why a ward scored as it did, and “the model said so” is not an answer a department can give.

How we approach it

Normalise the channels before scoring anything. News from television and print, citizen complaints, public service feedback forms, and automated phone surveys and call logs are ingested and normalised into one record shape in near real time, with source, channel and geography retained on every record. The geography is the field everything downstream depends on, so it is resolved at ingest rather than inferred later.

A sentiment engine that combines trained models with rules. The engine we built parses and tokenises text, scores sentiment at sentence level, and extracts keywords and tone indicators. Classification uses several techniques together — Naive Bayes, logistic regression and neural networks — alongside rule-based scoring for regional dialect and colloquial phrasing that statistical models consistently misread. The rule layer is not a legacy component. It is there because it is more accurate on the phrases that matter most locally, and because it can be explained.

Labelled data as a deliverable. Model accuracy on this kind of corpus comes from labelling, not architecture. The labelling scheme, and who owns it, is agreed at the start.

Aggregation with suppression and composition. Scores roll up to city, district and ward with a minimum record threshold below which nothing is published, and every published score carries the channel composition behind it.

Visualisation built for drill-down. Bubble maps at city, district and ward level, dashboards for stakeholders, and drill-down by time range, region and subject. On the original delivery this was integrated with an enterprise SAS analytics platform because that was the department’s existing reporting environment. Meeting an organisation in the analytics tool it already licences is usually cheaper than moving it.

Anomaly detection on movement, not level. Alerts fire on sudden shifts in a locality relative to its own baseline and relative to the wider trend, which is what makes the difference between a local event and a national one.

What we would not do. We would not score individuals. We would not publish a ward score below the data threshold. And we would not present a sentiment index as a measure of service quality — it measures expressed sentiment, and conflating the two is how a dashboard ends up driving decisions it cannot support.

What it takes

Access to the channels, and clarity on the legal basis. Complaint and call data is personal data. Retention, access control and de-identification have to be settled before ingestion, not after.

Labelling effort in the target languages. Someone who knows the local idiom has to label a corpus. This is the single largest determinant of accuracy and the line item most often underestimated.

An owner for the output. A sentiment map with no team accountable for acting on it becomes a screen in a room nobody visits.

Agreement on what will not be measured. Naming the questions the platform is not allowed to answer, up front, is what keeps it usable for a full term of office.

Where this has been done

This is a shipped reference under confidentiality. Between 2018 and 2019 we built a sentiment analytics platform for a government end user, engaged through an enterprise partner. It aggregated news, citizen complaints, feedback forms and telephony data, scored sentiment with a custom Java NLP engine plus trained models, and delivered bubble-map visualisation at city, district and ward level with anomaly alerting on sudden shifts. It achieved 92% sentiment classification accuracy.

Neither the department nor the enterprise partner is named.

The same pipeline shape applies wherever unstructured feedback has to become a geographic or cohort signal: brand and reputation monitoring, service quality across a branch network, or student and parent feedback across an education system.

Position on this page

Evidence

Delivered work

Industry

Government & Civic

Written for

Operations, Head of Product, Compliance

Outcome

Multi-channel citizen feedback scored for sentiment and aggregated to city, district and ward level, with anomaly alerts when a locality shifts.

Jurisdictions

  • India

Questions we get asked

Straight answers.

How accurate is automated sentiment classification on this kind of data?
The platform we delivered achieved 92% sentiment classification accuracy. That number is specific to its channels, languages and labelling scheme. Anyone quoting a generic accuracy figure for sentiment analysis without naming the corpus is quoting nothing.
Does complaint volume tell you what citizens think?
No, and treating it that way is the most common error in civic analytics. Complaint channels measure who complains, which correlates with access, literacy and prior experience of being heard. We report channel composition alongside every score for exactly this reason.
Can it handle regional dialects and mixed-language text?
Partly, and that is where a rule-based layer earns its place. Statistical models trained on formal text mishandle colloquial and dialect phrasing, so the engine we built combined trained models with rule-based scoring for specific regional expressions.
Can it score sentiment about individual public servants?
It can, technically. We advise against deploying it that way. A sentiment score attached to a named individual invites decisions the measurement cannot support, and it changes the incentives of the people generating the input.

Read next

Related work.

Case studies

Is this your problem?

Bring the constraint that makes your version harder than this one. That is the part worth an hour.