[Backend] Feed campaign proper nouns to the ASR as vocabulary bias #355
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found in the August 2026 session lifecycle review (#319).
Why
Fantasy proper nouns are precisely what a generic speech model gets wrong, and no amount of downstream prompting repairs a name the ASR never heard. Quest Board is unusually well placed here: it already holds every PC name, NPC name, place and faction for the campaign in its own wiki.
Most providers accept some form of vocabulary bias — keyterms, keyword boosting, custom dictionaries, or an initial prompt. The provider contract already carries a
vocabularyinput; this issue fills it.Proposed fix
Assemble a per-campaign term list from the wiki: character names, NPC names, places, factions, and aliases, ranked by recency and appearance count so the list stays inside provider limits (commonly a couple of hundred terms). Pass it on every transcription request for that campaign. Refresh it as the wiki grows.
Measure the effect on the golden corpus rather than assuming it, and record the result — this is the kind of change that is easy to believe in and hard to verify.
Acceptance criteria
vocabularyinput on every requestLanded in PR #491 (merged 2026-09-05, CI green, 1750 tests).
app/services/vocabulary_service.pyassembles the list per session from three sources in survival tiers — party character names, then wiki titles of proper-noun types plus NPC cards ranked by session appearances and recency, then aliases — deduped after ranking so the better-ranked spelling wins; trashed entries and unaccepted bot proposals excluded so the pipeline cannot teach itself its own misspelling.reminder_tasks.resolve_asr_vocabularyreads the resolved ASR provider's declared vocabulary style and limit, and the list travels on every request: plain, VAD, per-span, and the language probe. No cache; it is rebuilt from the wiki each time a recording is processed.Not claimed: "measured effect against the golden corpus" — the #433 harness that can measure proper-noun survival is being built now; the measurement is a follow-up there. Also note: the bundled WhisperX server ignored
initial_promptuntil its API v2 (Rhoving/iac-repo#396, deploying today), so the bias only takes effect against the updated server.Measured effect of the vocabulary bias (PR #505; synthetic-session harness ASR leg against the bundled WhisperX server, API v2,
large-v3-turbo, the invented campaign's marker script).The #433 calibration had been run with vocabulary off, so that run is the no-bias baseline. Three conditions, each run twice:
Two things to try next, tracked separately: WhisperX v2 also honours
hotwords, which was not exercised here, and the marker scorer's denominator needs a small fix before the two assemblies can be compared against each other (filed as a harness follow-up).