espnet3.systems.asr.metrics.ter.TER
Less than 1 minute
espnet3.systems.asr.metrics.ter.TER
class espnet3.systems.asr.metrics.ter.TER(bpemodel: str | Path, ref_key: str = 'ref', hyp_key: str = 'hyp', clean_types: Iterable[str] | None = None)
Bases: BaseMetric
Compute TER (token error rate) for a dataset.
TER is the error rate over the model’s subword (BPE) tokens: the reference and hypothesis text are tokenized with a SentencePiece model, then scored like WER over the resulting token sequences. This mirrors espnet2’s Stage 13 scoring, which computes ter at the bpe token level.
Initialize the TER metric.
- Parameters:
- bpemodel – Path to the SentencePiece model used to tokenize text into subword tokens (typically the recipe’s trained
bpe.model). - ref_key – Key name for reference text entries.
- hyp_key – Key name for hypothesis text entries.
- clean_types – Optional cleaner types passed to TextCleaner.
- bpemodel – Path to the SentencePiece model used to tokenize text into subword tokens (typically the recipe’s trained
