mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
18 lines
393 B
Python
18 lines
393 B
Python
|
from abc import ABC, abstractmethod
|
||
|
from typing import List, Tuple
|
||
|
|
||
|
|
||
|
class BaseCrossEncoder(ABC):
|
||
|
"""Interface for cross encoder models."""
|
||
|
|
||
|
@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.
|
||
|
"""
|