aac_metrics.classes.sbert_sim module

class SBERTSim(
return_all_scores: bool = True,
*,
sbert_model: str | SentenceTransformer = 'paraphrase-TinyBERT-L6-v2',
device: str | device | None = 'cuda_if_available',
batch_size: int | None = 32,
reset_state: bool = True,
verbose: int = 0,
)[source]

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

Cosine-similarity of the Sentence-BERT embeddings.

For more information, see sbert().

compute() tuple[SBERTSimScores, SBERTSimScores] | 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] = -1.0
reset() None[source]
training: bool
update(
candidates: list[str],
mult_references: list[list[str]],
) None[source]