ESPnet3 Metrics Configuration
Less than 1 minute
ESPnet3 Metrics Configuration
This page explains the metrics.yaml schema used by the measure stage.
Important
Metrics run after inference and read SCP outputs from inference_dir.
Minimum required keys
Typical metrics runs need:
metricsinference_dir
dataset.test is optional. If it is omitted, ESPnet3 scans subdirectories under inference_dir and uses those names as test sets.
Basic shape
recipe_dir: .
exp_tag:
exp_dir: ${recipe_dir}/exp/${exp_tag}
metrics:
- metric:
_target_: espnet3.systems.asr.metrics.wer.WER
ref_key: ref
hyp_key: hypOptional explicit test-set definitions:
dataset:
_target_: espnet3.components.data.data_organizer.DataOrganizer
recipe_dir: ${recipe_dir}
test:
- name: test-clean
data_src_args:
split: test-cleanMain sections
| Section | Description |
|---|---|
inference_dir | Root directory containing per-test-set SCP outputs |
dataset.test | Optional explicit test-set names |
metrics | Metric definitions and optional SCP input mappings |
metrics
Each list entry contains:
metric- optional
inputs
Example:
metrics:
- metric:
_target_: espnet3.systems.asr.metrics.wer.WER
clean_types: ["whisper_basic"]
inputs:
ref: ref
hyp: hypIf inputs is omitted, ESPnet3 falls back to the metric's ref_key and hyp_key attributes.
SCP input mapping
Each inputs entry maps to a file under:
${inference_dir}/${test_name}/Example:
inputs.ref: ref->${inference_dir}/${test_name}/ref.scpinputs.hyp: hyp->${inference_dir}/${test_name}/hyp.scp
Output
The metrics stage writes:
${inference_dir}/metrics.jsonEach metric produces one result block keyed by its class path.
