equality scorer

This commit is contained in:
Xi Yan 2024-10-23 16:07:17 -07:00
parent cad8c8710b
commit 4b1d7da030
5 changed files with 53 additions and 23 deletions

View file

@ -217,6 +217,7 @@ class ScoringRouter(Scoring):
async def score(
self, input_rows: List[Dict[str, Any]], scoring_functions: List[str]
) -> ScoreResponse:
res = {}
# look up and map each scoring function to its provider impl
for fn_identifier in scoring_functions:
score_response = await self.routing_table.get_provider_impl(
@ -225,6 +226,6 @@ class ScoringRouter(Scoring):
input_rows=input_rows,
scoring_functions=[fn_identifier],
)
print(
f"fn_identifier={fn_identifier}, score_response={score_response}",
)
res.update(score_response.results)
return ScoreResponse(results=res)