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.cer

Character-level error metrics

This module provides utilities to compute character error rate (CER) and character-level edit distance between reference and hypothesis text sequences.

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

Note

Functions

character_error_rate_per_pair

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

Compute character error rate (CER) for each reference-hypothesis pair.

Parameters

Returns

Raises

See-Also

metrics.uer.universal_error_rate_per_pair : Type-agnostic version.

Note

character_edit_distance_per_pair

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

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

Parameters

Returns

character_error_rate

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

Compute the corpus level character error rate (CER) over all pairs.

Parameters

Returns

Note

character_error_rate_ci

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

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

Parameters

Returns

Note