mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-03 18:32:55 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user