Skip to content

Commit d4d0883

Browse files
authored
fix: Result output (#57)
1 parent 485f01b commit d4d0883

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

docs/quickstart.ipynb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
{
4343
"cell_type": "code",
44-
"execution_count": null,
44+
"execution_count": 2,
4545
"id": "0b7179f7",
4646
"metadata": {},
4747
"outputs": [],
@@ -86,7 +86,7 @@
8686
{
8787
"data": {
8888
"application/vnd.jupyter.widget-view+json": {
89-
"model_id": "c4a622ce9f774cf7b79b46d9fcf05f69",
89+
"model_id": "b445c1d1ed654516946e7c7f49850c0b",
9090
"version_major": 2,
9191
"version_minor": 0
9292
},
@@ -178,7 +178,7 @@
178178
},
179179
{
180180
"cell_type": "code",
181-
"execution_count": 8,
181+
"execution_count": 4,
182182
"id": "22eb6f97",
183183
"metadata": {},
184184
"outputs": [
@@ -187,19 +187,19 @@
187187
"output_type": "stream",
188188
"text": [
189189
"Loading cached processed dataset at /home/jjmachan/.cache/huggingface/datasets/explodinggradients___fiqa/ragas_eval/1.0.0/3dc7b639f5b4b16509a3299a2ceb78bf5fe98ee6b5fee25e7d5e4d290c88efb8/cache-f5ed219a49e8fb1f.arrow\n",
190-
"100%|████████████████████████████████████████████████████████████| 1/1 [00:18<00:00, 18.95s/it]\n",
191-
"100%|████████████████████████████████████████████████████████████| 2/2 [01:09<00:00, 34.97s/it]\n",
190+
"100%|████████████████████████████████████████████████████████████| 1/1 [00:18<00:00, 18.28s/it]\n",
191+
"100%|████████████████████████████████████████████████████████████| 2/2 [00:34<00:00, 17.38s/it]\n",
192192
"Loading cached processed dataset at /home/jjmachan/.cache/huggingface/datasets/explodinggradients___fiqa/ragas_eval/1.0.0/3dc7b639f5b4b16509a3299a2ceb78bf5fe98ee6b5fee25e7d5e4d290c88efb8/cache-2a93a2841bc4d586.arrow\n",
193-
"100%|████████████████████████████████████████████████████████████| 1/1 [00:07<00:00, 7.49s/it]\n"
193+
"100%|████████████████████████████████████████████████████████████| 1/1 [00:07<00:00, 8.00s/it]\n"
194194
]
195195
},
196196
{
197197
"data": {
198198
"text/plain": [
199-
"{'ragas_score': 0.860, 'context_relavency': 0.817, 'faithfulness': 0.892, 'answer_relevancy': 0.874}"
199+
"{'ragas_score': 0.8629, 'context_relavency': 0.8167, 'faithfulness': 0.9028, 'answer_relevancy': 0.8738}"
200200
]
201201
},
202-
"execution_count": 8,
202+
"execution_count": 4,
203203
"metadata": {},
204204
"output_type": "execute_result"
205205
}
@@ -226,7 +226,7 @@
226226
},
227227
{
228228
"cell_type": "code",
229-
"execution_count": 12,
229+
"execution_count": 5,
230230
"id": "8686bf53",
231231
"metadata": {},
232232
"outputs": [
@@ -345,14 +345,14 @@
345345
"4 [The time horizon for your 401K/IRA is essenti... 0.737 \n",
346346
"\n",
347347
" faithfulness answer_relevancy \n",
348-
"0 1.0 0.922 \n",
349-
"1 1.0 0.923 \n",
350-
"2 1.0 0.824 \n",
351-
"3 1.0 0.830 \n",
352-
"4 1.0 0.753 "
348+
"0 1.0 0.922 \n",
349+
"1 1.0 0.923 \n",
350+
"2 1.0 0.824 \n",
351+
"3 1.0 0.830 \n",
352+
"4 1.0 0.753 "
353353
]
354354
},
355-
"execution_count": 12,
355+
"execution_count": 5,
356356
"metadata": {},
357357
"output_type": "execute_result"
358358
}

src/ragas/evaluation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,6 @@ def __repr__(self) -> str:
132132
score_strs = []
133133
if "ragas_score" in scores:
134134
ragas_score = scores.pop("ragas_score")
135-
score_strs += f"'ragas_score': {ragas_score:0.4f}"
135+
score_strs.append(f"'ragas_score': {ragas_score:0.4f}")
136136
score_strs.extend([f"'{k}': {v:0.4f}" for k, v in scores.items()])
137137
return "{" + ", ".join(score_strs) + "}"

0 commit comments

Comments
 (0)