1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Error-rate metrics for ASR output and for the intelligibility leg of TTS eval.
//!
//! Two callers need this and neither should reimplement it:
//!
//! - **Corpus QC.** A transcript is training ground truth. Measuring an ASR's
//! word error rate against a read script is how we learn whether an
//! ASR-transcribed corpus is usable at all.
//! - **TTS eval.** Intelligibility of generated speech is ASR WER over that
//! speech against the text it was asked to say.
//!
//! **CPU-only, no tensors.** Levenshtein over token sequences: two rows of
//! `O(hypothesis)` state, one pass per utterance.
//!
//! # Two tokenizers, one metric each
//!
//! WER is meaningless without saying how text was tokenized, because that
//! choice moves the number by several points. This module offers two, and a
//! caller states which one it used:
//!
//! - [`normalize()`] counts what is written. Hyphens become spaces and digits
//! stay digits, so `ter-delete` is two tokens and `250` never matches
//! `two hundred and fifty`. Word counts over a prompt need this.
//! - [`canonicalize`] counts what is spoken. Number words and digits collapse
//! to one form and a standalone Malay affix joins the token after it, so
//! two spellings of the same utterance score as a match.
//!
//! Scoring speech against a prompt uses [`canonicalize`]. Measuring how a
//! corpus is written uses [`normalize()`].
pub use ;
pub use ;
pub use normalize;