Errors and Alignments.
Chenzi Xu · chenzi.xu@ntu.edu.sg
Hold all morning: a WER gap describes the system and the test, never a deficit in the speakers.
1. The CTC collapse rule, in order?
merge repeats, then delete blanks
2. What does attention compute for each output token?
a probability distribution over the encoder frames, then their weighted sum
3. How do you score a transcript against its reference?
lowercase and strip punctuation on both sides, then WER = (S + D + I) ÷ reference words
4. What can Whisper print for five seconds of silence?
fluent text that nobody said: a hallucination
5. With no lexicon file and no separate language model, what remains to change in a recognizer?
its training data
Today: 16 Oct (Week 9)
Due: Fri 23 Oct, 23:59
Weight: 30%
Everything task-specific is in the brief on NTULearn. Corpus audio and transcripts stay inside the module.
Ssubstitution Iinsertion ✓match D, deletion: none here N: words in the reference (6, then 7: we’ll became two words)
Ei: errors in utterance i Ni: reference words in utterance i U: number of utterances Σi: add up over the utterances
An average can hide
a gap between groups.
Nothing in the WER formula is biased. The bias is in what gets averaged,
over whom, and which number a team chooses to report.
The authors: the gap arises “primarily from a performance gap in the acoustic models”.
Koenecke et al. (2020), PNAS 117(14), 7684–7689 (quoted).
Usable is not equitable.
Ten minutes.
Then: whose speech is in the data.
After the break: the National Speech Corpus, then forced alignment, which uses the classical HMM, lexicon and Viterbi as a measuring tool.
Age band and education were collected (Koh et al. 2019); check your copy's speaker file before planning an age contrast.
Check these four points for any corpus before you use it.
Forced alignment is recognition
with the transcript given.
The words are fixed. Viterbi decides only when each phone starts and ends.
The practical gives you a TextGrid made with MFA; running MFA yourself is optional.
Run the audit.
Then listen to the errors.
illustrative layout: overall WER per system, then the same WER split by condition
Stages 1 to 4 are the in-class core; the take-home is optional.
A1 steps 5 and 6, rehearsed
No results file yet? The class file runs every stage.
From the alignment of the two strings, “the minimum number of word substitutions, word insertions, and word deletions”; the rate “can be greater than 100%”. Course gloss: WER = 100 × (S + D + I) ÷ N, with N the words in the reference.
Jurafsky & Martin, SLP 3rd ed., §16.6 (quoted; Aug 2026 draft).“It’s normal for systems to normalize text before computing word error rate.” Course gloss: one fixed clean-up applied to reference and hypothesis (lowercase, punctuation, contractions, numerals); it is part of the metric and is reported with it.
J&M §16.6 (quoted). Whisper's normalizer: Radford et al. (2023), appendix on text standardization.Course wording: the same metric reported separately for each named group in the test set, with utterance and word counts per group. The standard scoring tool already allows it: “sclite also gives error rates by speaker”.
J&M §16.6 (quoted). Exemplar: Koenecke et al. (2020), PNAS 117(14), 7684–7689.Course wording: given audio and its known transcript, the assignment of time boundaries to the words and phones, by running the recognizer's Viterbi search over the fixed transcript.
Tool: McAuliffe et al. (2017), Proc. Interspeech 2017, 498–502 (Montreal Forced Aligner).REF: “Can lah, we’re going at 2 pm.” HYP: “can lah we are going at two pm”. Compute the raw WER, then the WER after the lecture's normalizer.
System A: 8% on group M (majority accent), 25% on group C (code-switched). System B: 13% and 15%. A share p of the reference words is from group M. Write both overall WERs in terms of p; at which p does the ranking flip?
“makan” is missing from the aligner's dictionary. What does MFA write for it, what can you no longer measure, and what one-line fix restores it?
Using NSC metadata (gender, ethnic group, recording channel, part), name two audits it makes possible and two questions it cannot answer, and why.
Worked answers in the appendix at the end of this deck.
1. A WER needs its normalizer, its reference conventions and its test population stated beside it
2. An overall WER is a weighted average over groups; report WER for each group as well, with counts
3. In Koenecke et al. (2020) the gap stayed on matched phrases: it points to the acoustic model and its training audio
4. Forced alignment is Viterbi with the words known: a start and end time, so a duration, for every phone
Short and open access; read the methods as a model of an audit. pnas.org/doi/10.1073/pnas.1915768117
The Montreal Forced Aligner sections; updated web version at eleanorchodroff.com/tutorial. arxiv.org/abs/1811.05553
WER, CER and text normalization. huggingface.co/learn/audio-course/chapter5/introduction
Readable now that you know HMMs. isca-archive.org/interspeech_2017/mcauliffe17_interspeech.html
Bias beyond US English, written by a sociolinguist. dl.acm.org/doi/10.1145/3531146.3533117
Chapter numbers follow the Aug 2026 draft. web.stanford.edu/~jurafsky/slp3/17.pdf
The text-processing front end and the unit-selection videos. speech.zone/courses/speech-synthesis
Skim them so the interface is familiar before the practical. fon.hum.uva.nl/praat/manual/KlattGrid.html
By the synthesizer's creator.
The classical text-to-speech textbook (library copy).
One number is not enough.
Split it by group.
Jurafsky, D. & Martin, J. H. Speech and Language Processing, 3rd ed. (Aug 2026 draft). Ch. 16, §16.1 (Fig. 16.1, error rates by task) and §16.6 (word error rate; text normalization before evaluation). Quoted on the formal slide.
Koenecke, A., Nam, A., Lake, E., Nudell, J., Quartey, M., Mengesha, Z., Toups, C., Rickford, J. R., Jurafsky, D. & Goel, S. (2020). “Racial disparities in automated speech recognition.” PNAS 117(14), 7684–7689. The audit in Lecture I.
Koh, J. X., Mislan, A., Khoo, K., Ang, B., Ang, W., Ng, C. & Tan, Y.-Y. (2019). “Building the Singapore English National Speech Corpus.” Proc. Interspeech 2019, 321–325. The corpus.
IMDA. National Speech Corpus. Singapore Open Data Licence v1.0. The data.
Radford, A., Kim, J. W., Xu, T., Brockman, G., McLeavey, C. & Sutskever, I. (2023). “Robust speech recognition via large-scale weak supervision.” Proc. ICML 2023, PMLR 202, 28492–28518. Whisper; Fig. 3 and the text normalizer.
McAuliffe, M., Socolof, M., Mihuc, S., Wagner, M. & Sonderegger, M. (2017). “Montreal Forced Aligner: trainable text-speech alignment using Kaldi.” Proc. Interspeech 2017, 498–502. The aligner.
Chodroff, E. (2018). Corpus Phonetics Tutorial. arXiv:1811.05553; online edition eleanorchodroff.com/tutorial. MFA commands.
Markl, N. (2022). “Language variation and algorithmic bias: understanding algorithmic bias in British English automatic speech recognition.” Proc. FAccT ’22, 521–534.
Hugging Face. Audio Course, Unit 5: evaluation metrics for ASR. huggingface.co/learn/audio-course. WER, CER and normalization in code.
Montreal Forced Aligner documentation (v3.x). montreal-forced-aligner.readthedocs.io. Commands and out-of-vocabulary handling.
A(p) = 8p + 25(1 − p) and B(p) = 13p + 15(1 − p), with p = group M's share and 1 − p = group C's share of the reference words. Equal when 25 − 17p = 15 − 2p: 15p = 10, p = 2/3. Above two thirds group M, A has the lower average; below, B does. The models never changed: only the mix did.
mfa validate flags “makan” as out-of-vocabulary; MFA aligns it as spoken noise (spn): one interval with no boundaries between its phones, so its vowels cannot be measured, and its edges with the neighboring words are less reliable. Fix: add one tab-separated dictionary line (makan, then its phones in the acoustic model's phone set) and re-align. A fixed lexicon again, but here the fix is one line you add yourself.
Possible, for example: WER by gender within Part 3; base-vs-fine-tune gains by ethnic group on a part the fine-tune was not trained on (it used Part 2). Not answerable, for example: whether errors track how many Singlish features (particles, Singlish grammar) an utterance contains (no such column: register is not recorded per utterance), or speakers' language dominance (ethnic group is an administrative category, not a linguistic profile). Metadata names cells; it does not describe repertoires.
| our “kopi” table | MFA's English model (english_mfa 3.1, used in the practical) | |
| States per phone | 1 | 3 for most phones (beginning, middle, end); only the middle one can stay. Silence: 5, all can stay |
| Stay probability | 0.5, the same everywhere | Learned from 3,573 hours, per phone and group of similar contexts; middle-state medians: /k/ 0.87, /ɔ/ 0.83, /p/ 0.87, /i/ 0.83 (/ə/ 0.73, /s/ 0.90) |
| Shortest phone | 1 frame | 1 frame (10 ms) is possible, but rare: leaving after the first state has probability 0.01 |
| Emissions | Made-up probabilities | Gaussian mixtures (several bell curves added together, fitted to data) over Week 4's MFCCs: each frame plus 3 neighbors on each side, reduced to 40 numbers |
| Context | One /ɔ/ for every context | Triphones: the model for /ɔ/ depends on its left and right neighbors, and similar contexts share one; 5,600 shared state models in all |
| Speakers | No adaptation | Adapted to each speaker's voice |
| Table for “kopi” | 4 rows × 8 columns | About 12 rows (4 phones × 3 states) plus silence; 40 columns for a 400 ms “kopi” (illustrative) |
Values read from the model file (final.mdl) with MFA 3.3.3; McAuliffe et al. (2017)
| phone | stay probability a (middle state, learned) | average length the transitions imply | length MFA chose here |
MFA's design: only the middle state can repeat; the beginning and end states last one frame each. (Classic Kaldi lets all three repeat, so every phone lasts at least 30 ms.)
a: the middle state's stay probability · 1/(1 − a): its average number of frames · 2: the beginning and end states, one frame each · 10 ms: one frame
Scores: log-likelihoods from the model MFA used for this alignment (english_mfa 3.1, speaker-independent pass), recomputed with Kaldi's gmm-compute-likes; they match MFA's own scores exactly. The same synthetic “Kopi, please” clip