refactor: update type hint and remove unused import (#1436)

change typehint on `_invert_score` from `List[float]` to `float`. remove
unnecessary typing import
This commit is contained in:
forrestmckee
2024-07-09 03:26:45 -05:00
committed by GitHub
parent 58c2cd01a5
commit b4436e0804

View File

@@ -1,5 +1,3 @@
from typing import List
import pyarrow as pa
from .base import Reranker
@@ -112,6 +110,6 @@ class LinearCombinationReranker(Reranker):
# these scores represent distance
return 1 - (self.weight * score1 + (1 - self.weight) * score2)
def _invert_score(self, scores: List[float]):
# Invert the scores between relevance and distance
return 1 - scores
def _invert_score(self, score: float):
# Invert the score between relevance and distance
return 1 - score