CAIMAN-ASR benchmark

The benchmark streams audio to a CAIMAN-ASR server in real time, as a user would, and measures the word error rate (WER) and the user-perceived latency. It’s the caiman_benchmark command in the caiman_eval package, which uv installs and runs, with the repository’s default development tools. It needs no GPU or torch:

git clone https://github.com/MyrtleSoftware/caiman-asr-dev.git && cd caiman-asr-dev

Run all the commands below from the repository’s root.

Note on the datasets

The benchmark reads a JSONL manifest, passed with --manifest, and --data_dir, the directory that its relative audio paths are relative to. Please refer to benchmarking with custom datasets for instructions on how to use a custom dataset.

LibriSpeech dev-clean

To benchmark on LibriSpeech dev-clean, first download it, with a manifest of its word alignments:

uv run --locked caiman_benchmark download-librispeech

It prints the --manifest and --data_dir to pass to the commands below.

CAIMAN-ASR

caiman_benchmark run is composed of 2 steps which are both performed in sequence. There are however flags to control the flow and skip individual steps.

  1. Transcription
  2. Evaluation

Running the command will perform both steps.

uv run --locked caiman_benchmark run --manifest <manifest> --data_dir <audio_dir> --address <ADDRESS> --port <PORT> --run_name <unique name> --append_results caiman-base --lang_code <lang-code>

where --address is the websocket address of transcription service and --port is the port. --append_results selects the CSV file the results are added to. caiman_benchmark run --help lists all the options and their allowed values.

Note on client speed

The client simulates a real user by feeding the audio to the server at real time. Since there are several hours of audio, the client will take several hours to run.

To instead do a trial run on just five audio files, pass the flag --limit_to 5.

Transcription

This step runs the transcription step and generates *.caiman-asr.trans transcription files. These are saved under --run_name (see --help), mirroring the audio folder layout. For each audio file, the script generates one transcription file.

By default, the transcription is skipped for already done audio, which will happen if you run the script another time with the same run_name. This behavior can be changed by passing the --force_transcription flag, and all files will be transcribed from scratch and existing transcription files will be overwritten.

uv run --locked caiman_benchmark run --manifest <manifest> --data_dir <audio_dir> --address <ADDRESS> --port <PORT> --force_transcription --run_name <name of previous run> --append_results caiman-base --lang_code <lang-code>

The transcription step can be skipped by passing the --skip_transcription flag.

uv run --locked caiman_benchmark run --manifest <manifest> --data_dir <audio_dir> --address <ADDRESS> --port <PORT> --skip_transcription --run_name <name of previous run> --append_results caiman-base --lang_code <lang-code>

Evaluation

This step aggregates the generated trans files into a hypothesis JSONL and computes word error rate (WER) and latency. The evaluation step can be skipped by passing the --skip_evaluation flag.

uv run --locked caiman_benchmark run --manifest <manifest> --data_dir <audio_dir> --address <ADDRESS> --port <PORT> --skip_evaluation --run_name <unique name> --append_results caiman-base --lang_code <lang-code>

Prefix (punctuation/casing and language)

--prefix selects the output format and language, for example for English with a model that accepts punctuation and language tags:

uv run --locked caiman_benchmark run --manifest <manifest> --data_dir <audio_dir> --address <ADDRESS> --port <PORT> --run_name <unique name> --append_results caiman-base --prefix='<pnc><lang_en>' --lang_code en

See Prefix for the prefixes a model accepts and the default. --lang_code controls evaluation normalization, not the model language.

Keyword Boosting

To boost keywords, pass them to --keywords as a space-separated list, e.g.

uv run --locked caiman_benchmark run --manifest <manifest> --data_dir <audio_dir> --address localhost --run_name keyword-test \
  --append_results caiman-base --lang_code en \
  --keywords caiman asr myrtle --keyword-c0 0.3 --keyword-beta 0.9 \
  --keyword-context-score 1.5

The --keyword-* flags override the server’s boost controls, the same for each file; see Keyword boosting. Use a new --run_name when comparing settings to avoid reusing transcripts.

Flush

Add --manual-flush to enable Enter-to-flush in an interactive terminal:

uv run --locked caiman_benchmark run --manifest <manifest> --data_dir <audio_dir> --address localhost --run_name flush-test \
  --append_results caiman-base --lang_code en \
  --manual-flush

Press Enter while audio is streaming to finalize a segment and continue on the same connection. Acknowledgements are saved as flush_received events; word timestamps remain relative to the file start. Each file still ends with an end-of-input message.

With --pause_after_each, Enter at the prompt after a file finishes advances to the next file. Flushing can affect WER and latency, so compare against a run without flushing and record when you pressed Enter.