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

Point-of-interest (POI) evaluation metrics for sequence comparison.

This module implements metrics inspired by the PIER (Point of Interest Error Rate) algorithm introduced in:

"PIER: A Novel Metric for Evaluating What Matters in Code-Switching"
by Ugan et al.

The metrics focus evaluation on specific positions (points of interest) within a sequence, allowing selective comparison between reference and hypothesis sequences.

Note that the algorithm explained by Ugan et al. works on a word token level, while this version takes an iterable of any type. Hence, if you want the same results you have to pre-tokenize your strings.

All functions are thin wrappers around optimized native bindings.

Functions

poi_edit_distance

poi_edit_distance(references: Iterable[Any], hypotheses: Iterable[Any], points_of_interest: Iterable[bool]) -> List[int]

Compute edit distance restricted to points of interest.

Parameters

Returns

Note

References

  1. Ugan, E. Y., Pham, N. Q., Bärmann, L., & Waibel, A. (2025, April). Pier: A novel metric for evaluating what matters in code-switching. In ICASSP 2025-2025 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) (pp. 1-5). IEEE.

poi_error_rate

poi_error_rate(references: Iterable[Iterable[Any]], hypotheses: Iterable[Iterable[Any]], points_of_interest: Iterable[Iterable[bool]]) -> float

Compute point-of-interest (POI) error rate over multiple sequences.

Parameters

Returns

Note

References

  1. Ugan, E. Y., Pham, N. Q., Bärmann, L., & Waibel, A. (2025, April). Pier: A novel metric for evaluating what matters in code-switching. In ICASSP 2025-2025 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) (pp. 1-5). IEEE.