Back to Case Studies

Ethos Guard: Responsible Speech Analytics for Urdu & Roman Urdu

My doctoral research prototype at the University of Karachi: a multimodal system that reviews a recorded speech session (words, tone and facial cues) and gives the speaker explained, advisory feedback before they publish. Built for the code-switched Urdu / Roman Urdu / English register that mainstream tooling handles badly.

Ethos Guard dashboard overview with live risk tiles
nlpmultimodal mlroman urdupython / fastapireactphd research

The Problem

Hate-speech detection research exists for English, and lately for Urdu text in isolation. But Pakistani public speech (talk shows, lectures, vlogs) happens in a code-switched mix of Urdu, Roman Urdu and English, spoken aloud, where harm is carried jointly by the words, the delivery and the face. No public system or corpus covers that register. My PhD (Computer Science, University of Karachi) is building both; Ethos Guard is the working prototype.

Three Design Rules, Enforced in Code

  • Identity is not harm. Ethnic, religious and gender terms never raise a flag on their own. Only group reference + hostile predicate + generaliser ("yeh sab… ghaddar hain") produces a group-targeting flag. This rule exists because early lexicon systems (including the one I inherited) listed ordinary identity words as slurs, which is exactly the bias the research critiques.
  • Negation is respected, in Urdu grammar too. "Hum nafrat ke khilaf hain" is counter-speech, and the analyzer knows it, Urdu negation is largely post-positional, which forward-window keyword systems miss. The classic failure of flagging "we reject hatred and violence" as incitement is fixed and pinned by regression tests.
  • Advisory, never a verdict. The system tells a speaker that a segment touches a sensitive area and should be reviewed before publishing. It never cites statutes and never issues determinations, in the Pakistani context a false accusation is a safety risk, so this constraint is written into the code and the thesis alike.

What the Speaker Sees

Every flagged sentence is located in time, typed, scored for severity and paired with a safer-wording hint:

Transcript risk review with per-segment flags and safer-wording hints

Tone and facial channels run alongside the text, and a fusion score re-weights itself when a modality is missing:

Audio tone analysis and facial cue analysis panels Final recommendation report with sensitivity advisories

The Engineering

  • Analysis engine, negation-aware, identity-safe lexicon analysis with a pluggable toxicity-model interface (a transparent heuristic today, a fine-tuned encoder next; nothing is called a transformer until it is one).
  • FastAPI + React. The dashboard consumes live per-segment findings from the same pipeline the CLI and notebook use.
  • Research pipeline, Whisper transcription and segmentation, a rule-based Urdu-script → Roman Urdu transliterator, spelling normalisation, eGeMAPS prosody and facial action-unit extraction, and a Krippendorff's-alpha agreement calculator verified against the textbook example.
  • Evaluation harness, grouped cross-validation (a video never spans folds), macro-F1 with bootstrap confidence intervals, subset analysis for implicit and sarcastic harm, paired significance tests. Benchmark runners for text-only baselines, LLM zero-shot, and multimodal fusion ablations.
  • 56 automated tests, including ones that fail the build if counter-speech ever flags or a statute name ever appears in output.

Where the Research Goes Next

The prototype anchors a three-part study: a failure taxonomy of current text-only systems (including frontier LLMs) on code-switched Pakistani speech; a tri-modal annotated corpus of public speech with honestly reported inter-annotator agreement; and an ablation measuring what prosody and facial evidence actually add over text. The corpus (features, timestamps and labels, never raw video or face imagery) is the contribution the field can reuse.

What This System Does Not Do

It does not moderate other people's content, it does not judge legality, and it excludes religious-domain content from its corpus by design. It is a mirror for the speaker, not a gavel, and that framing is what makes it defensible.

Need this built? See full-stack AI development, or browse the case studies.

Working on NLP Beyond English?

I build and evaluate language systems for code-switched and low-resource settings, with claims the data actually supports. If you are scoping speech analytics, content-risk review, or Urdu/Roman Urdu NLP, let's talk.