Expand description
The bench’s corpus: the audio a run scores against, taken from this machine’s own material and from the slice the binary carries.
Three sources, and what each can say is different. A saved take is
this machine’s own speech with the in-use model’s words beside it -
latency on real material, but its text.txt is a model’s output, not
truth: the consensus tier reads how far the candidate sits from the
model in use, which is a signal and not an error. The read-aloud set is
the one source whose words are known, because they are a passage
somebody read aloud on purpose - only a clip from it can be scored for
term accuracy, and everything here keeps that distinction in the types.
The public slice is the exception to “nothing is embedded”. It is a fixed LibriSpeech test-clean slice carried in the binary and installed beside the models on first bench, so a machine that never recorded anything still has known words to score against.
Re-exports§
use std::path::Path;🔒use std::time::Duration;🔒use sha2::Digest as _;🔒use sha2::Sha256;🔒use crate::Config;🔒use crate::Error;🔒use crate::SAMPLE_RATE;🔒use crate::Stages;🔒
Modules§
- assets 🔒
- The public bench slice that ships in the binary: LibriSpeech test-clean utterances, their transcripts, and the attribution the licence asks for.
Structs§
- Clip
- One clip of audio, and whatever is known about it.
- Clip
Outcome 🔒 - One clip’s transcription as the loop needs it.
- ClipRun
- One clip’s outcome, as the callback sees it while a run is out.
- Corpus
- The audio a run scores against, and its identity.
- Corpus
Id - What two runs are comparable by: the corpus’s own shape and bytes.
- Manifest 🔒
- The manifest the installed public slice carries beside its clips.
- Manifest
Clip 🔒 - One clip the public manifest names: a wav, its digest, and the words it was read from.
- Metrics
- What one run measured.
- Stage
Totals - Where one run’s time went, summed over its clips.
Enums§
- Clip
Source - Where one clip came from.
- Tier
- Which clips a run scores against, in the names the page uses.
Constants§
- KNOWN_
TERMS 🔒 - The words a mishearing shows up in, across the whole corpus. A term survives when it comes out whole and spelled right, case-insensitively - which is the figure a bench exists to move.
- READ_
ALOUD_ PASSAGE - The passage the read-aloud set is recorded from: the one document whose words are known, so a run over it can be scored rather than compared. Read aloud once, kept like a model artifact, and re-used for every future candidate.
Functions§
- corpus
- Build one tier’s corpus from the machine’s own material, and the installed public slice where the tier asks for it.
- corpus_
id 🔒 - The identity two runs are comparable by: the clip count, the seconds of audio, and a hash over every clip’s own samples, so two corpora that differ by one take cannot share an id.
- decode_
reader 🔒 - decode_
wav 🔒 - Decode one 16-bit mono wav at the model’s own rate, refusing anything else by name rather than resampling it.
- edits 🔒
- Word-level Levenshtein distance: the edits between two word sequences.
- install_
public_ corpus - Install the bundled public slice into
models_dir’spublic-corpusdirectory. Idempotent: a slice this binary wrote is left alone, and a manifest it did not write is replaced by the bundled one. - public_
corpus - The installed public slice: every clip the manifest names, each verified against its own digest before anything scores it.
- ratio
- One count’s share of another,
0.0when there is nothing to divide by. - read_
aloud - The read-aloud set: the passage, and every recording of it this machine has kept - each scored against the passage as its truth.
- run
- Run one corpus through one config, reporting each clip as it lands.
- samples_
seconds 🔒 - A count of samples as seconds at the model’s own rate.
- score
- Term accuracy and word error rate of
textagainsttruth. - store_
read_ aloud - Write one recording into the read-aloud set: the passage read, the take the words were recorded in, and a manifest naming the wav’s own sha256.
- store_
read_ 🔒aloud_ at store_read_aloudfor a caller that brings its own stamp, which is how two recordings in one millisecond are testable at all.- takes
- Every complete take in
dir, oldest first. - terms
- The passage’s own terms: every word in it the vocabulary knows, whole words only, deduplicated, in the passage’s order.
- walk 🔒
- Walk the corpus, handing each clip’s outcome to
on_clip; aBreakstops the run where it stands. - wer
- Word error rate of
textagainsttruth: edits over the truth’s own words, and no error when the truth has none. - words 🔒
- A string’s words: lowercased, split on anything that is not a letter or a digit, blanks dropped. The one spelling both axes compare on.