Match Error Rate¶
Module Interface¶
- class torchmetrics.MatchErrorRate(compute_on_step=None, **kwargs)[source]
Match Error Rate (MER) is a common metric of the performance of an automatic speech recognition system.
This value indicates the percentage of words that were incorrectly predicted and inserted. The lower the value, the better the performance of the ASR system with a MatchErrorRate of 0 being a perfect score. Match error rate can then be computed as:
- where:
is the number of substitutions,
is the number of deletions,
is the number of insertions,
is the number of correct words,
is the number of words in the reference ().
- Parameters
- Returns
Match error rate score
Examples
>>> preds = ["this is the prediction", "there is an other sample"] >>> target = ["this is the reference", "there is another one"] >>> metric = MatchErrorRate() >>> metric(preds, target) tensor(0.4444)
Initializes internal Module state, shared by both nn.Module and ScriptModule.
- update(preds, target)[source]
Store references/predictions for computing Match Error Rate scores.
Functional Interface¶
- torchmetrics.functional.match_error_rate(preds, target)[source]
Match error rate is a metric of the performance of an automatic speech recognition system. This value indicates the percentage of words that were incorrectly predicted and inserted. The lower the value, the better the performance of the ASR system with a MatchErrorRate of 0 being a perfect score.
- Parameters
- Return type
- Returns
Match error rate score
Examples
>>> preds = ["this is the prediction", "there is an other sample"] >>> target = ["this is the reference", "there is another one"] >>> match_error_rate(preds=preds, target=target) tensor(0.4444)