Shortcuts

BLEU Score

Module Interface

torchmetrics.BLEUScore[source]

alias of _BLEUScore

Functional Interface

torchmetrics.functional.bleu_score(preds, target, n_gram=4, smooth=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`
>>> _bleu_score(preds, target)
tensor(0.7598)