Logo Lanfrica

jethro-achi/call-language-diagnostic

Domaine:

natural language processing
Créateur:
jet
Hôte:
Read-only diagnostic: how many Inconclusive call-center calls are failed Luganda/local-language transcriptions # call-language-diagnostic A **read-only** diagnostic for the HFB call-center QA database. ## What it answers Of the calls sitting at `resolution_status = 'Inconclusive'` (or any status you pass), **how many are actually failed local-language transcriptions** (Luganda / Runyankole / etc.) rather than genuinely ambiguous English calls? The Azure Whisper deployment transcribes English calls accurately but produces phonetic **word-salad** for Ugandan local languages — text that *looks* like a transcript but carries no meaning, so the scorer cannot judge resolution and the call ends up `Inconclusive`. This tool measures how big that bucket is. ## How it works (no audio, no API, no cost) Whisper's failed local-language output is still stored in `calls.transcription`. That salad barely overlaps with English vocabulary, so `probe.py` classifies each stored transcript straight from the text: - **English-word ratio** — fraction of words that are common English / banking terms. - **Local-language markers** — count of known Luganda/Runyankole tokens (`webale`, `akawunti`, `sente`, `ninyenda`, `omusala`, …). - Cross-checks against the `language_detected` value GPT already stored per call. Each call is labelled `english`, `likely_local_language`, `mixed_or_uncertain`, `too_short`, or `empty`, and the tool prints a summary + examples + optional CSV. > **Strictly read-only.** It only runs `SELECT`s. It does **not** rescore, > re-transcribe, or write anything to the database. ## Requirements - Python 3 with `psycopg2` — already present in the callcenter app venv. - DB credentials, read from the callcenter `.env` via `--env-file` (nothing is hard-coded or committed here). ## Usage (on the server) ```bash CC=/home/octech-admin/callcenter # Main run: how many Inconclusive calls are failed local-language transcripts $CC/venv/bin/python probe.py --env-file $CC/.env # Narrow to a date range and dump a per-call CSV to send back $CC/venv/bin/python probe.py --env-file $CC/.e …