Saving Predictions
val.sh dumps the predicted text and per-file WER for the cuts of its
--val_manifests to /results/preds_[timestamp]_[step].json, as in this command:
./scripts/val.sh --model_config /path/to/model_config.yaml --val_standardizer_lang en \
--val_manifests your-inference-list.cuts.jsonl.gz --val_data_dir /path/to/audio
Predictions can be generated using other checkpoints by specifying the --checkpoint argument.
val.sh works whether or not there are correct ground-truth transcripts in the manifest. If there are,
then the word error rate reported by val will be accurate; if not, then it will be nonsense and should
be ignored.
To make a manifest from a list of audio files, write them in a JSON file
whose audio paths are relative to --val_data_dir:
[
{
"transcript": "dummy",
"files": [{ "fname": "relative-path/to/stem1.wav" }]
},
{
"transcript": "dummy",
"files": [{ "fname": "relative-path/to/stem2.wav" }]
}
]
where “dummy” can be replaced by the ground-truth transcript for accurate word error rate calculation.
Then convert it into your-inference-list.cuts.jsonl.gz in the directory given
as the second argument (here .), which must not already hold that file:
python -m caiman_train.lhotse.scripts.convert json2cuts \
your-inference-list.json . --data-dir /path/to/audio
Each prediction’s cut_id is the id of its cut, which for a manifest made this
way is the file’s fname followed by - and the JSON file’s name, e.g.
relative-path/to/stem1.wav-your-inference-list.json.