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,
Bases:
AACMetric[tuple[SBERTSimScores,SBERTSimScores] |Tensor]Cosine-similarity of the Sentence-BERT embeddings.
Original implementation: https://github.com/blmoistawinde/fense
For more information, see
sbert().- compute() tuple[SBERTSimScores, SBERTSimScores] | Tensor[source]¶