aac_metrics.classes.bleu module

class BLEU(return_all_scores: bool = True, *, n: int = 4, option: ~typing.Literal['shortest', 'average', 'closest'] = 'closest', verbose: int = 0, tokenizer: ~typing.Callable[[str], list[str]] = <method 'split' of 'str' objects>)[source]

Bases: AACMetric[tuple[dict[str, Tensor], dict[str, Tensor]] | Tensor]

BiLingual Evaluation Understudy metric class.

For more information, see bleu().

compute() tuple[dict[str, Tensor], dict[str, Tensor]] | Tensor[source]
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.

full_state_update: ClassVar[bool | None] = False
get_output_names() tuple[str, ...][source]
higher_is_better: ClassVar[bool | None] = True
is_differentiable: ClassVar[bool | None] = False
max_value: ClassVar[float] = 1.0
min_value: ClassVar[float] = 0.0
reset() None[source]
training: bool
update(
candidates: list[str],
mult_references: list[list[str]],
) None[source]
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

class BLEU3(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 BLEU4(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