We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb9da37 commit 16407eaCopy full SHA for 16407ea
src/ragas/metrics/context_relevance.py
@@ -159,7 +159,10 @@ def _score_batch(
159
if output.lower() != "insufficient information."
160
else []
161
)
162
- score = min(len(indices) / len(context_sents), 1)
+ if len(context_sents) == 0:
163
+ score = 0
164
+ else:
165
+ score = min(len(indices) / len(context_sents), 1)
166
overlap_scores.append(score)
167
if self.strictness > 1:
168
agr_score = self.sent_agreement.evaluate(n_response)
0 commit comments