1 Per-Show Dictionaries
Xena Rathon edited this page 2026-06-22 15:33:53 -04:00

Per-Show Dictionaries (Premium Names + Additive Mining)

Whisper mishears character and place names ("Gojo" → "Gozo", "Alabasta" → "Arabasta"). A per-show dictionary fixes that: it primes Whisper with the correct spellings and corrects mishears in post. Dictionaries make a show's dubtitles "premium" — names spelled right from episode 1.

Where they live

/<config>/glossaries/<exact show folder name>.json — on the bind-mounted config dir, so they persist across container rebuilds and auto-reload every sweep. Drop a file in, and it applies to all current and future episodes of that show. (This is why One Pace gets perfect One Piece names.)

Shape

{
  "show": "Jujutsu Kaisen",
  "initial_prompt": "This is Jujutsu Kaisen. Spell names correctly: Yuji Itadori, Satoru Gojo, Sukuna…",
  "names": ["Yuji", "Itadori", "Gojo", "Sukuna", "Megumi", "domain", "expansion"],
  "hard_fixes": { "goujou": "Gojo", "fushigoro": "Fushiguro" }
}
  • initial_prompt — primes Whisper (prevents the mishear up front).
  • names — a fuzzy-match correction list (catches close mishears).
  • hard_fixes — exact misheard→canonical swaps Whisper makes repeatedly.
  • _curated: true — marks a hand-authored dictionary (optional).

Dictionaries are per-show, so one show's names never leak into another. A show with no dictionary just gets a neutral prompt and no name substitution.

Additive auto-mining (the dictionary grows itself)

Before generating each show, mine_glossary.py runs automatically:

  1. Loads the show's existing dictionary (curated or previously mined).
  2. Mines only the NEW episodes (ones without a dubtitle yet) — it extracts each episode's embedded English subtitle and finds recurring proper nouns (capitalized words that appear mid-sentence ≥ MINE_MIN_COUNT times, filtered against a common-word list).
  3. Appends any new names — it never rebuilds from scratch, so curated names, hard_fixes, and a curated initial_prompt are preserved.

So when new episodes are added to a show, the next sweep reloads the old dictionary and mines just the new episodes for new terms — additive growth, not a rebuild. Each episode is mined exactly once (when it's new), because mining skips episodes that already have a dubtitle.

MINE_MIN_COUNT (default 3) controls how many times a name must recur to be added — raise it to be stricter, lower it to catch rarer names.

Seeding a show by hand

For a favourite show, drop a curated dictionary (accurate main-cast names + a prompt) into glossaries/. Mining will then augment it with show-specific terms from the subs. The repo ships 15 seed dictionaries (One Pace + 14 popular shows) as examples.

Re-doing a show with a better dictionary

Dictionaries apply going forward. To regenerate already-finished episodes with an improved dictionary, delete that show's …eng.dubtitles.srt / …eng.dubtitles.ass sidecars — the next sweep treats them as new (re-mines + re-transcribes).