neuraltrain.metrics.metrics.CharacterErrorRates¶
- class neuraltrain.metrics.metrics.CharacterErrorRates(blank_idx: int = 0)[source][source]¶
CTC greedy-decoded character error rate, returned in percent.
Wraps
torchmetrics.text.CharErrorRatefor a CTC head: greedy-decodesy_pred(collapse repeats + drop blanks), maps the integer label IDs to a private per-character alphabet viachr, and delegates the Levenshtein accumulation to the parent class.Inputs¶
- y_pred
(B, T_out, n_classes) Log-probs from a CTC head.
- y_true
(B, max_target_length) Integer labels padded with
blank_idx. Per-row label counts are recovered as(y_true != blank_idx).sum(-1).
- y_pred