From 5457b3ce4eabe9c9ab3b3e4add4aee9569e0ee03 Mon Sep 17 00:00:00 2001 From: Morgan McGuire Date: Tue, 10 Dec 2024 21:16:51 +0000 Subject: [PATCH] update relevance scorer --- weave/scorers/context_relevance_scorer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/weave/scorers/context_relevance_scorer.py b/weave/scorers/context_relevance_scorer.py index 6c05f070d19..cce86edceda 100644 --- a/weave/scorers/context_relevance_scorer.py +++ b/weave/scorers/context_relevance_scorer.py @@ -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