Skip to content

Commit

Permalink
update relevance scorer
Browse files Browse the repository at this point in the history
  • Loading branch information
morganmcg1 committed Dec 10, 2024
1 parent 19707f6 commit 5457b3c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions weave/scorers/context_relevance_scorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ def score(
total_length += total_tokens

final_score = total_weighted_score / total_length if total_length > 0 else 0.0
output = {"flagged": final_score > self.threshold}
output['extras'] = {'score': final_score}
res = {"flagged": final_score > self.threshold}
res['extras'] = {'score': final_score}
if return_all_scores:
output['extras']['all_spans'] = all_spans
return output
res['extras']['all_spans'] = all_spans
return res

0 comments on commit 5457b3c

Please sign in to comment.