Repository navigation
Conversation
The benchmark suite could run a translation but not judge it: no quality metric existed, no row carried a translation reference, and the two timestamps that describe what the reader saw were not recorded. - chrF per row and per language pair, using sacrebleu's definition (char order 6, word order 0, beta 2, whitespace removed) and its effective-order smoothing. The pair figure is computed from the summed [hyp, ref, match] statistics, not from a mean of row scores, because a mean over-weights short rows. Inputs can be empty: a reference with an empty hypothesis is a 0% measurement, a row with no reference is unscored (`chrf: null`). - The parallel-corpus join happens when the manifest is loaded, keyed on `sentence_id`, so `fleurs-90.json` and its hashes stay unchanged. Rows that already speak the target language are left unscored rather than scored against themselves. - `final_translation_time_s` records when the complete validated translation landed after feed start. `provisional_lead_s` is null unless the MT backend actually drafts over the unstable ASR tail, so a backend that publishes only committed translations is not credited with a lead it does not have. - Schema 3.2 records the MT configuration (target language, backend, model, simultaneous-MT settings) next to the ASR backend and model, and prints the corpus chrF per language pair in the terminal summary. sacrebleu is not a runtime dependency: the implementation is checked against values computed once with sacrebleu 2.6.0 and pinned in the tests.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #477
Summary
The suite can already run a translation but could not judge one: there was no translation quality metric anywhere, rows carried no translation reference, and the timings that describe what a reader actually saw were missing. This adds those three, following the acceptance criteria in the issue and the follow-ups in your comment on it.
whisperlivekit/benchmark/chrf.py: chrF per row and per language pair. Character n-gram order 6, word n-gram order 0, beta 2, whitespace removed, effective-order smoothing — sacrebleu's definition. The pair figure is computed from the summed[hypothesis, reference, match]counts over the rows of that pair, not from a mean of row scores, which is biased toward short rows. Empty inputs are distinguished: a reference with an empty hypothesis is a 0% measurement, while a row with no reference is unscored (chrf: null).load_manifest(..., target_language=...): references come from the row of the samesentence_idin the target language. The manifest file and its hashes are only read, sofleurs-90.jsonstays byte-identical (asserted in a test). A row that already speaks the target language is left unscored instead of being scored against itself.final_translation_time_sis the complete validated translation measured from feed start.provisional_lead_sis null unless the MT backend actually drafts: the harness flags a draft the first timebuffer_translationis non-empty, so a backend that publishes only committed translations is not credited with a lead it does not have. The measurement comes from theFrontDatasnapshots the harness already sees, so it does not depend on feat: caption event stream for display consumers #449.translation.configrecords the target language, backend, model and simultaneous-MT settings next to the ASR backend and model, asbenchmarks/README.mdasks. The terminal summary gains a chrF column per row and a corpus chrF line per language pair;--transcriptionsalso prints the translation reference and hypothesis.sacrebleu is not added as a runtime dependency. The implementation is checked against three values (including a Mandarin case) plus a corpus figure computed once with sacrebleu 2.6.0 and pinned in the test.
User impact
benchmarks/evaluations/are untouched and are not compared with 3.2 runs.translation.config, so their output is unchanged apart from the schema number.benchmarks/README.md, including the command line for an audio-to-translation run.Validation
Implementation compared against
sacrebleu.CHRF()2.6.0 (char order 6, word order 0, beta 2,whitespace=False, default effective-order smoothing):the cat sat on a mat/the cat sat on the mathello world this is test/hello world, this is a test.fleurs-90.json(en_1682) with punctuation restoredFuzz comparison, 196 non-empty randomized pairs over mixed Latin/CJK/punctuation text: every per-row value matched to 1e-9, and a 30-row corpus figure matched too.
End-to-end run through the real
BenchmarkRunner._run_samplecode with a fake harness standing in only for the model (so the audio hashing, timing capture, scoring and report paths are the real ones), on a synthetic 3-row parallel manifest whose French rows share the Englishsentence_id:wlk bench --manifest benchmarks/corpora/fleurs-90.json --config translation.json --languages enparses and runs to completion through the real CLI path (the audio files themselves are not cached on this machine, so the samples reportFileNotFoundError; the manifest, join and report paths above are exercised directly).Test suite (
uv-managed optional dependencies not installed on this machine):The 6 failures are
tests/test_deepgram_compat.py(needsdeepgram-sdk) andtests/test_qwen3_backend_shims.py(needs the qwen3 backends); they fail identically on unmodifiedmainin this environment, verified by stashing the change and re-running those files. New tests: 23 pass (19 in the two new files, plus the existingtests/test_benchmark.pyunchanged and green).Not run: real model ASR/MT passes (
tests/test_pipeline.py,tests/test_asr_coalescing_pipeline.py), which download Whisper and load NLLB/AlignAtt; no GPU or MLX backend on this machine. The chrF path and the latency plumbing are model-independent and are covered without them, but the first real audio-to-translation report still needs a machine with a backend and a sidecar.python -m ruff check .— All checks passed.Checklist
ruff check ..