Source code for langchain_community.cross_encoders.base

from abc import ABC, abstractmethod
from typing import List, Tuple


[docs]class BaseCrossEncoder(ABC): """Interface for cross encoder models."""
[docs] @abstractmethod def score(self, text_pairs: List[Tuple[str, str]]) -> List[float]: """Score pairs' similarity. Args: text_pairs: List of pairs of texts. Returns: List of scores. """