Validate accuracy¶
Score the benchmark's transcripts against reference transcripts, to check
that a platform, chunk length or format doesn't cost accuracy. A run with
references writes a word error rate (WER) on every measured stream (only
speaker 0 of each load under --concurrency), and
snap-asr-bench-score turns one or more runs into a table. How references
are read and scored is in Accuracy (WER).
1. Write the references¶
Manual transcription of one clip. Transcribe what is said, as plain
text in a .txt file next to the clip. Write words as they're spoken
(numbers in words if they were said that way). Case and punctuation don't
matter. Mark non-speech in brackets ([laughs], [inaudible]), which
scoring drops.
Several clips. Write a manifest CSV with a reference per row. Paths are relative to the manifest:
clip_id,uri,reference,recording
kitchen-01,clips/kitchen-01.mp4,refs/kitchen-01.txt,phone
street-02,s3://<bucket>/inputs/street-02.mp4,s3://<bucket>/refs/street-02.txt,glasses
short-03,clips/short-03.wav,,glasses
A short reference can go inline in a reference_text column instead.
Extra columns, like recording here, can be grouped by when scoring.
resources/examples/manifests/ has examples to copy from, with
sample references.
Ego4D and Ego-Exo4D. A manifest of dataset clips can name the
dataset's own transcript files in a transcript_path column:
- Ego4D rows point at the AV benchmark's
av_train.jsonorav_val.json, and the row'suidmust be the clip'sclip_uid. Each clip scores against its own utterances. A whole-video row is refused, because only its 5-minute AV clips are transcribed, and is measured without a score. - Ego-Exo4D rows point at a take's
aria*_transcriptions.json, the file for the Aria glasses the take used (usuallyaria01). Its schema isn't in the public Ego-Exo4D docs, so it's read as generic segment JSON. If a file isn't recognised,reference_errornames its top-level keys: check one file and extendreference.pyif needed.
If the manifest names paths on another machine, copy the media and
transcript files to S3 and map the paths with --rewrite, so they resolve
on the inference hosts.
Example manifests¶
resources/examples/manifests/ holds small manifests to copy or run as they are:
| File | Rows | Shows |
|---|---|---|
minimal.csv |
3 | Only clip_id and uri: relative, S3 and absolute paths. No scoring. |
with-references.csv |
4 | References as files (refs/*.txt), inline (reference_text) and missing, plus recording and duration_bucket columns to group by. |
ego4d-av.csv |
3 | Ego4D AV clips with the default column names (uid, media_path, transcript_path), scored against av_train.json. Paths are relative to a dataset copy's ego4d_data/ folder. |
egoexo4d-takes.csv |
5 | Short Ego-Exo4D takes and their transcript files. Paths are relative to the dataset root. |
The clips in the first two are placeholders for your own. For the dataset
examples, copy the manifest to the dataset root it names, so its relative
paths resolve there, or map them with --rewrite, for example
--rewrite v2/=s3://<bucket>/ego4d/ego4d_data/v2/. The folder's
README.md has the commands.
To strip a larger manifest down, use the selection flags instead of
editing it: --where, --require-reference, --sample N --seed S and
--limit N.
2. Run with references¶
One clip:
uv run snap-asr-bench clips/kitchen-01.mp4 --reference clips/kitchen-01.txt \
--targets targets.toml --chunk-seconds 1,2,5 --pacing afap
A manifest, on every inference host, keeping only short Ego-Exo4D clips that have a reference:
BUCKET="$(terraform -chdir=terraform output -raw bucket_name)"
deploy/client/run-on-hosts.sh --manifest "s3://$BUCKET/manifests/egoexo4d.csv" \
--rewrite "/data/datasets/=s3://$BUCKET/datasets/" \
--where duration_bucket=0-30s,30-60s --require-reference \
--chunk-seconds 1,2,5 --pacing afap \
--warmup-input "s3://$BUCKET/inputs/<warmup-file>" --warmup-seconds 60
afap pacing gives the same transcripts as realtime in a fraction of the
time, since the server sees the same chunks. Use --sample 20 --seed 1 for
a quick check before the full set. Each stream's summary line ends with its
WER.
3. Score¶
uv run snap-asr-bench-score events.jsonl
For on-host runs, download each host's file and score them together:
aws s3 cp --recursive "s3://$BUCKET/results/" results/ --exclude '*' --include 'onhost-<timestamp>-*'
uv run snap-asr-bench-score results/onhost-<timestamp>-*/events.jsonl --csv wer.csv
wer is pooled: total errors over total reference words in the group, so
long clips weigh more. mean_stream_wer weighs every stream equally.
Group by manifest columns to see where errors come from:
uv run snap-asr-bench-score events.jsonl --by target,duration_bucket
uv run snap-asr-bench-score events.jsonl --by target,chunk_seconds,activity --streams-csv streams.csv
Reading the results¶
- Compare like with like. Compare targets on the same clips and
configuration.
inputsin the table counts clips per run, so grouping several hosts' files withouttargetcounts each host's copy of a clip. - Failed chunks inflate WER. A failed request leaves its audio
untranscribed, which counts as deletions.
streams_with_failuresshould be 0. - Chunk boundaries cost words.
independentstreams cut words atfixedboundaries. Compare with--boundary silenceorgrowing. growingpast--max-window-secondsonly transcribes the last window, so its WER on long clips is mostly deletions.- Concurrency. Under
--concurrencyonly speaker 0 of each load is scored, and the table splits byconcurrencyby default. For WER alone,--concurrency 1scores every stream it sends. - Reference quality. Ego4D AV transcripts cover English speech only. Dataset transcripts may miss speakers or be machine-made, so check how a dataset's transcripts were produced before trusting absolute WER. Treat absolute WER as approximate, and differences between targets on the same clips as the result.