GitHub - heydonna-app/record-test-bench: Record Test Bench (RT bench): scorers and runner for multi-stage deposition transcript cleanup (proofreading, speaker correction, legal formatting)

GitHub

5 min read Original article ↗

Code for The Record Test Bench: Evaluating Multi-Stage Transcript Cleanup for Deposition Audio (rt-v1.1 technical report, Rajiv Poddar, HeyDonna, 2026). RT bench scores language models on the three stages a court reporter performs on a machine-generated deposition draft: proofreading (against the audio), speaker correction (anonymous diarization codes to named speakers) and legal formatting. It uses five public, certified depositions, chains the stages (stage N+1 consumes the real output of stage N) and keeps every failed draw in the denominator.

What is released, and what is withheld

Released Withheld
All scorers: proofreading (WER, nWER, CER, insertion/deletion), speaker correction (cpWER, name accuracy, turn-boundary F1, Q/A role accuracy, turn-speaker accuracy), formatting (legal-structure F1, punctuation F1, word preservation) The production prompts for the three stages (text, examples, rule files). Available on request: rajiv@heydonna.law
The run orchestrator benchmarks/rt_bench.py, spend contract rt_contract.py, adapters rt_adapters.py, speed metrics rt_speed.py, leaderboard renderer rt_leaderboard.py, dataset lock The stage executors that build requests from those prompts and call providers (proofreading/runner.py, sc/ladder_arms.py, formatting/__main__.py are stubs that exit 3)
tools/aggregate_reps.py (mean [min-max] over repetitions) and tools/reproduce_from_hf.py (rescores the published outputs) Reference projection code and the private certified PDFs (the projected references are on Hugging Face)
prompts/interface.py: the interface where your own prompts plug in

A re-run with your own prompts measures a different system. It is not a replication of the published numbers; the published numbers are "model plus HeyDonna production prompt". Scoring, by contrast, is fully reproducible.

Install

python3 -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt        # jiwer, rapidfuzz, PyYAML, numpy, pydantic (versions of the published run)

Reproduce the published scores (no API key, no prompts, no audio)

python3 tools/reproduce_from_hf.py --cache .hf-cache --report reproduce-report.json

This downloads read-only from the two Hugging Face datasets at the pinned commits above (text only, about 90 MB), hash-checks the projected references against benchmarks/rt_dataset_lock.json, rescores every published model output with the same functions the runner uses (rt_bench.score_proofread, score_sc, score_format), and compares

  1. every published per-file score, and
  2. every published headline statistic (mean, min, max over repetitions 2 and 3 per model, the numbers in the paper's result tables and on the leaderboard).

It exits 0 only if everything matches within 6e-5 (published values are rounded to four decimals). Expect it to take about 10-20 minutes (use --jobs N to set parallelism): SC and formatting scoring align 100-300 kB transcripts word by word. With the versions in requirements.txt (Python 3.11) it reported 533 per-file values and 126 headline statistics, 0 mismatches.

Aggregate result files yourself

tools/aggregate_reps.py <RESULTS_DIR> reads the per-run result JSONs written by rt_bench.py (schema rt-v1-results/1) and prints mean [min-max] over repetitions 2 and 3 per model. The raw run result files are not bundled here; their per-file and aggregate content is in the results dataset (data/rt-v1.1/*.jsonl).

Run the orchestrator (needs your own stage executors)

export RT_BENCH_ROOT=/path/to/bench-root        # staged dataset, projected GT, runs/ (never commit)
export OPENROUTER_API_KEY=...                   # only for paid runs
export RT_PROMPTS_MODULE=my_prompts             # your PromptProvider, see prompts/README.md
python -m benchmarks.rt_bench estimate --models gemini-3.8-flash          # no network, no provider calls
python -m benchmarks.rt_bench run --model gemini-3.8-flash --spend-cap-usd <CAP> --confirm-paid
python -m benchmarks.rt_bench score --model gemini-3.8-flash --run-dir <RUN_DIR>   # rescore saved outputs, $0

How the runner calls models: rt_bench.py drives three subprocesses per model, in order: the proofread stage (audio models only, one process per file, 300-second audio chunks), the speaker-correction stage and the format stage. Every stage routes through OpenRouter under one shared, flock-serialized spend ledger (rt_contract.SharedBudget): a reservation is charged before dispatch, only verified billing releases it, and a corrupt or missing ledger fails closed. A paid run requires --spend-cap-usd and --confirm-paid. Each run writes execution.json (git SHA, source digests, settings, dataset binding) before any call, then one results JSON with scores, costs and settings and no transcript text or speaker names. The stage file contracts are in prompts/README.md.

Repository layout

benchmarks/rt_bench.py            orchestrator, result schema, scoring entry points
benchmarks/rt_contract.py         shared spend ledger, dataset lock verification, route bounds
benchmarks/rt_adapters.py         stage hand-off (SC input, format input), label/row parsing
benchmarks/rt_speed.py            speed and throughput metrics
benchmarks/rt_leaderboard.py      leaderboard renderer
benchmarks/rt_dataset_lock.json   SHA-256 of every reference and staged file
benchmarks/proofreading/scorer/   proofreading metrics (jiwer based)
benchmarks/sc/scorer/             speaker-correction metrics (mapped turns, cpWER)
benchmarks/formatting/scorer/     legal structure, punctuation, preservation, Q/A, placeholders
benchmarks/formatting/single_model.py   model pins and request-settings identity (prompt-free subset)
prompts/                          interface and documentation for the withheld prompts
tools/                            aggregate_reps.py, reproduce_from_hf.py
paper/                            rt-v1.1 technical report (PDF)

Differences from the source tree

The code was copied from the sponsor's internal repository at commit 4b14365420e11e57d12ba22f4c5d07ef26ce4f6f with these changes only; every other line is unchanged apart from removed internal comments and issue references (the non-comment code of every touched scorer file is AST-identical to the source):

  • formatting/__main__.py: the scoring function moved to formatting/scoring.py (body unchanged); the stage runner is a stub.
  • formatting/single_model.py and sc/pricing.py: reduced to the prompt-free parts (pins, prices, slugs, request_settings, request_receipt). The temperature-omission policy that the internal version loaded from production code is inlined (same decision).
  • rt_adapters.py project and the reference projection modules are removed (they need the private certified transcripts and the production document mapper); the projected references are published instead.
  • rt_bench.execution_plan hashes only source files that exist in the checkout.
  • The result files' embedded source digests refer to the internal tree and cannot be matched to this repository.

Rights and use

The code is MIT licensed (see LICENSE). Datasets carry their own licenses and notices: no blanket license covers the entire package, third-party audio keeps its source license, and rights, privacy or takedown requests go to legal@heydonna.law. RT bench measures stage outputs against one certified transcript per file. It is not a measure of readiness to certify a transcript, and results must not be used to claim that any system can replace a certifying reporter.