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 68c7ed6 commit af55f18Copy full SHA for af55f18
requirements/dev.txt
@@ -2,7 +2,7 @@ rich
2
ruff
3
isort
4
black[jupyter]
5
-pyright
+pyright==1.1.338
6
llama_index
7
notebook
8
sphinx-autobuild
src/ragas/metrics/_context_recall.py
@@ -116,10 +116,14 @@ def _score_batch(
116
for response in responses:
117
response = load_as_json(response[0])
118
if response:
119
+ response = [
120
+ int(item.get("Attributed", "").lower() == "yes")
121
+ if item.get("Attributed")
122
+ else np.nan
123
+ for item in response
124
+ ]
125
denom = len(response)
- numerator = sum(
- item.get("Attributed").lower() == "yes" for item in response
- )
126
+ numerator = sum(response)
127
scores.append(numerator / denom)
128
else:
129
scores.append(np.nan)
0 commit comments