aac_metrics.classes.vocab module

class Vocab(return_all_scores: bool = True, *, seed: None | int | ~torch._C.Generator = 1234, tokenizer: ~typing.Callable[[str], list[str]] = <method 'split' of 'str' objects>, dtype: ~torch.dtype = torch.float64, pop_strategy: ~typing.Literal['max', 'min'] | int = 'max', verbose: int = 0)[source]

Bases: AACMetric[tuple[VocabScores, VocabScores] | Tensor]

VocabStats class.

For more information, see vocab().

compute() tuple[VocabScores, VocabScores] | Tensor[source]
full_state_update: ClassVar[bool | None] = False
get_output_names() tuple[str, ...][source]
higher_is_better: ClassVar[bool | None] = None
is_differentiable: ClassVar[bool | None] = False
max_value: ClassVar[float] = inf
min_value: ClassVar[float] = 0.0
reset() None[source]
training: bool
update(
candidates: list[str],
mult_references: list[list[str]] | None = None,
) None[source]