aac_metrics.classes.bleu module¶
- class BLEU(
- return_all_scores: True =
True, - *,
- n: int =
4, - option: 'shortest' | 'average' | 'closest' =
'closest', - verbose: int =
0, - tokenizer: Callable[[str], list[str]] =
str.split, - class BLEU(
- return_all_scores: False,
- *,
- n: int =
4, - option: 'shortest' | 'average' | 'closest' =
'closest', - verbose: int =
0, - tokenizer: Callable[[str], list[str]] =
str.split, Bases:
Generic[T_BLEUOut],AACMetric[T_BLEUOut]BiLingual Evaluation Understudy metric class.
For more information, see
bleu().- extra_repr() str[source]¶
Return the extra representation of the module.
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
- update(
- candidates: list[str],
- mult_references: list[list[str]],
- class BLEU1(return_all_scores: bool = True, option: ~typing.Literal['shortest', 'average', 'closest'] = 'closest', verbose: int = 0, tokenizer: ~typing.Callable[[str], list[str]] = <method 'split' of 'str' objects>)[source]¶
Bases:
BLEU
- class BLEU2(return_all_scores: bool = True, option: ~typing.Literal['shortest', 'average', 'closest'] = 'closest', verbose: int = 0, tokenizer: ~typing.Callable[[str], list[str]] = <method 'split' of 'str' objects>)[source]¶
Bases:
BLEU