Sacre BLEU Score¶
Module Interface¶
- torchmetrics.SacreBLEUScore[source]
alias of
_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']] :rtype: :py:class:`~torch.Tensor`
>>> _sacre_bleu_score(preds, target) tensor(0.7598)