Unified Text and Structured-Text Evaluation Toolkit for ESPnet3
Feature Request: Unified Text and Structured-Text Evaluation Toolkit for ESPnet3
Motivation
For ESPnet3, we are planning to use VERSA as the unified evaluation toolkit for audio outputs.
In the same spirit, we would like to develop a unified evaluation toolkit for text and structured-text outputs, covering not only conventional text metrics but also long-form and multi-speaker evaluation.
ESPnet increasingly supports tasks where the output is much richer than a single text string:
- Long-form ASR
- Meeting transcription
- Multi-speaker ASR
- Speaker-attributed transcription
- Diarization
- Speech translation
- Structured dialogue outputs
- Timestamped transcription
- SLU / structured prediction
- Speech-language-model outputs
Currently, evaluation is distributed across different scripts, external tools, and task-specific implementations. This makes it difficult to maintain consistent evaluation behavior, reproduce published results, and compare systems across ESPnet recipes.
The goal of this project is to provide a common evaluation framework for text and structured-text outputs, analogous to VERSA for audio evaluation.
Importantly, the goal is not to invent new evaluation metrics. Instead, the toolkit should provide a consistent interface to established evaluation methods and, wherever possible, reproduce the results of existing tools and ESPnet recipes.
A particularly important focus: long-form and multi-speaker evaluation
A major motivation for this toolkit is that modern speech systems increasingly operate on long-form and multi-speaker audio, where conventional sentence-level WER is not sufficient.
The toolkit should therefore treat long-form and multi-speaker evaluation as first-class use cases, rather than extensions added later.
Long-form ASR
The evaluator should support:
- Long recordings
- Document-level transcripts
- Utterance/segment-level transcripts
- Timestamps
- Segmentation differences between reference and hypothesis
- Insertion/deletion of segments
- Concatenated or continuous hypotheses
- Overlapping or slightly misaligned segments where applicable
- Evaluation over complete recordings rather than only pre-segmented utterances
The evaluation should make it possible to distinguish between differences caused by segmentation and differences caused by actual transcription errors.
This is particularly important for long-form ASR and speech-language models, where the system may generate a transcript with a segmentation structure different from the reference.
Multi-speaker ASR
Multi-speaker evaluation should also be a core capability.
This includes:
- Speaker-attributed transcripts
- Speaker diarization
- Multi-speaker ASR
- Meeting transcription
- Conversational speech
- Overlapping speech
- Unknown speaker identities
- Speaker permutation ambiguity
The toolkit should support established metrics such as:
- cpWER
- ORC-WER
- DER
- JER
- Speaker-attributed WER and related metrics
In particular, speaker permutation and alignment should be handled explicitly, rather than assuming that speaker labels in the hypothesis and reference have the same identities.
Proposed metric coverage
ASR / text recognition
At minimum:
- WER
- CER
- Token error rate
- SCTK-compatible scoring
- Multi-reference / alternative transcription handling
- Language-specific tokenization
- Configurable case and punctuation handling
- Whisper-style text normalization
The implementation should be validated against SCTK and existing ESPnet evaluation wherever applicable.
Speech translation / MT
The toolkit should provide a common interface for established MT metrics, including:
- BLEU
- chrF
- TER
- COMET and other commonly used learned metrics where practical
- SacreBLEU-compatible evaluation
Multi-speaker ASR / diarization
Support:
- cpWER
- ORC-WER
- DER
- JER
- Speaker-attributed WER
- Speaker permutation / optimal assignment
- Overlap-aware evaluation where supported
- Diarization + ASR joint evaluation
Structured-text evaluation
The framework should not assume that the output is simply string → string.
Many ESPnet3 systems produce structured outputs such as:
- Speaker-attributed transcripts
- Timestamped transcripts
- Dialogue turns
- JSON / JSONL
- Intent + slot structures
- Semantic parses
- Named entities
- Event structures
- Speech-language-model outputs
- Other task-specific structured predictions
A useful abstraction would therefore separate:
- Parsing
- Normalization
- Alignment / matching
- Scoring
This abstraction is particularly important for cpWER, DER, long-form alignment, and structured prediction.
Key design principle: compatibility with existing evaluation
A critical requirement is that the new toolkit should match existing evaluation results whenever possible.
For example, if an existing ESPnet recipe currently uses SCTK, the new implementation should be tested against SCTK and reproduce the same WER/CER and relevant statistics under equivalent settings.
Similarly:
- SacreBLEU results should be reproducible for MT evaluation.
- Existing cpWER implementations should produce equivalent results.
- DER/JER should be validated against the implementations currently used by ESPnet recipes and established benchmarks.
- Existing ESPnet recipe scores should remain unchanged when the new evaluator is substituted.
See the discussion in ESPnet PR #6735 for an example of why consistency with existing evaluation is important.
Compatibility with existing evaluation should be treated as a first-class requirement, not merely an implementation detail.
If there are unavoidable differences from an existing implementation, they should be explicitly documented and covered by regression tests.
Normalization
Normalization is particularly important because seemingly small differences can substantially affect ASR and MT scores.
The toolkit should support explicit and configurable normalization, including:
- Case normalization
- Punctuation removal
- Whitespace normalization
- Language-specific normalization
- Tokenization
- Detokenization
- Whisper-style normalization
- Custom normalization pipelines
The exact normalization configuration should be visible in the evaluation result so that a score can be reproduced.
Possible interface
The interface could follow the philosophy of VERSA: a common API with configurable metrics and preprocessing.
For conventional text:
espnet-text-eval \
--ref data/ref.txt \
--hyp data/hyp.txt \
--metric wer cer bleu