summaryrefslogtreecommitdiff
path: root/src/personalization/models/reranker/base.py
blob: 34cf6ce766cdad2ca0123a2d7323663ff9f9daa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from typing import List, Protocol

class Reranker(Protocol):
    def score(
        self,
        query: str,
        docs: List[str],
        **kwargs,
    ) -> List[float]:
        """
        Score multiple candidate documents for the same query.
        Higher score indicates higher relevance.
        Returns a list of floats with length equal to len(docs).
        """
        ...