Shortcuts

Sacre BLEU Score

Module Interface

torchmetrics.SacreBLEUScore[source]

alias of torchmetrics.text._deprecated._SacreBLEUScore

Functional Interface

torchmetrics.functional.sacre_bleu_score(preds, target, n_gram=4, smooth=False, tokenize='13a', lowercase=False, weights=None)[source]

Wrapper for deprecated import.

>>> preds = ['the cat is on the mat']
>>> target = [['there is a cat on the mat', 'a cat is on the mat']]
>>> _sacre_bleu_score(preds, target)
tensor(0.7598)
Return type

Tensor