diff --git a/src/torchmetrics/functional/text/sacre_bleu.py b/src/torchmetrics/functional/text/sacre_bleu.py index cb3a45b94f1..2f489887697 100644 --- a/src/torchmetrics/functional/text/sacre_bleu.py +++ b/src/torchmetrics/functional/text/sacre_bleu.py @@ -174,7 +174,7 @@ def _tokenize_base(cls, line: str) -> str: @classmethod def _tokenize_13a(cls, line: str) -> str: - """Tokenizes an line using a relatively minimal tokenization that is equivalent to mteval-v13a, used by WMT. + """Tokenizes a line using a relatively minimal tokenization that is equivalent to mteval-v13a, used by WMT. Args: line: input sentence @@ -193,7 +193,7 @@ def _tokenize_13a(cls, line: str) -> str: line = line.replace("<", "<") line = line.replace(">", ">") - return cls._tokenize_regex(line) + return cls._tokenize_regex(f" {line} ") @classmethod def _tokenize_zh(cls, line: str) -> str: