Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

evaluatio.metrics.wer

Word-level error metrics

This module provides utilities to compute word error rate (WER) and word-level edit distance between reference and hypothesis text sequences. All computations operate on whitespace-tokenized words. If you need more complex tokenizing, please see metrics.uer.

The functions accept any iterable of strings and internally convert them to a format compatible with the underlying native bindings.

Note

Functions

word_error_rate_per_pair

word_error_rate_per_pair(references: Iterable[str], hypotheses: Iterable[str]) -> List[float]

Compute word error rate (WER) for each reference-hypothesis pair.

Parameters

Returns

Raises

See-Also

metrics.uer.universal_error_rate_per_pair : Type-agnostic version.

Note

word_edit_distance_per_pair

word_edit_distance_per_pair(references: Iterable[str], hypotheses: Iterable[str]) -> List[int]

Compute word-level edit distance for each reference-hypothesis pair.

Parameters

Returns

See-Also

metrics.uer.universal_edit_distance_per_pair : Type-agnostic version.

Note

word_error_rate

word_error_rate(references: Iterable[str], hypotheses: Iterable[str]) -> float

Compute the corpus level word error rate (WER) over all pairs.

Parameters

Returns

Note

word_error_rate_ci

word_error_rate_ci(references: Iterable[str], hypotheses: Iterable[str], interations: int, alpha: float) -> ConfidenceInterval

Estimate a confidence interval for the word error rate via bootstrapping.

Parameters

Returns

Note