Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions docs/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "0b7179f7",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -86,7 +86,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c4a622ce9f774cf7b79b46d9fcf05f69",
"model_id": "b445c1d1ed654516946e7c7f49850c0b",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -178,7 +178,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 4,
"id": "22eb6f97",
"metadata": {},
"outputs": [
Expand All @@ -187,19 +187,19 @@
"output_type": "stream",
"text": [
"Loading cached processed dataset at /home/jjmachan/.cache/huggingface/datasets/explodinggradients___fiqa/ragas_eval/1.0.0/3dc7b639f5b4b16509a3299a2ceb78bf5fe98ee6b5fee25e7d5e4d290c88efb8/cache-f5ed219a49e8fb1f.arrow\n",
"100%|████████████████████████████████████████████████████████████| 1/1 [00:18<00:00, 18.95s/it]\n",
"100%|████████████████████████████████████████████████████████████| 2/2 [01:09<00:00, 34.97s/it]\n",
"100%|████████████████████████████████████████████████████████████| 1/1 [00:18<00:00, 18.28s/it]\n",
"100%|████████████████████████████████████████████████████████████| 2/2 [00:34<00:00, 17.38s/it]\n",
"Loading cached processed dataset at /home/jjmachan/.cache/huggingface/datasets/explodinggradients___fiqa/ragas_eval/1.0.0/3dc7b639f5b4b16509a3299a2ceb78bf5fe98ee6b5fee25e7d5e4d290c88efb8/cache-2a93a2841bc4d586.arrow\n",
"100%|████████████████████████████████████████████████████████████| 1/1 [00:07<00:00, 7.49s/it]\n"
"100%|████████████████████████████████████████████████████████████| 1/1 [00:07<00:00, 8.00s/it]\n"
]
},
{
"data": {
"text/plain": [
"{'ragas_score': 0.860, 'context_relavency': 0.817, 'faithfulness': 0.892, 'answer_relevancy': 0.874}"
"{'ragas_score': 0.8629, 'context_relavency': 0.8167, 'faithfulness': 0.9028, 'answer_relevancy': 0.8738}"
]
},
"execution_count": 8,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -226,7 +226,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 5,
"id": "8686bf53",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -345,14 +345,14 @@
"4 [The time horizon for your 401K/IRA is essenti... 0.737 \n",
"\n",
" faithfulness answer_relevancy \n",
"0 1.0 0.922 \n",
"1 1.0 0.923 \n",
"2 1.0 0.824 \n",
"3 1.0 0.830 \n",
"4 1.0 0.753 "
"0 1.0 0.922 \n",
"1 1.0 0.923 \n",
"2 1.0 0.824 \n",
"3 1.0 0.830 \n",
"4 1.0 0.753 "
]
},
"execution_count": 12,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
2 changes: 1 addition & 1 deletion src/ragas/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,6 @@ def __repr__(self) -> str:
score_strs = []
if "ragas_score" in scores:
ragas_score = scores.pop("ragas_score")
score_strs += f"'ragas_score': {ragas_score:0.4f}"
score_strs.append(f"'ragas_score': {ragas_score:0.4f}")
score_strs.extend([f"'{k}': {v:0.4f}" for k, v in scores.items()])
return "{" + ", ".join(score_strs) + "}"