rag-eval-kit-avan 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rag_eval_kit_avan-0.1.0/LICENSE +21 -0
- rag_eval_kit_avan-0.1.0/PKG-INFO +61 -0
- rag_eval_kit_avan-0.1.0/README.md +44 -0
- rag_eval_kit_avan-0.1.0/pyproject.toml +24 -0
- rag_eval_kit_avan-0.1.0/rag_eval_kit/__init__.py +4 -0
- rag_eval_kit_avan-0.1.0/rag_eval_kit/evaluator.py +32 -0
- rag_eval_kit_avan-0.1.0/rag_eval_kit_avan.egg-info/PKG-INFO +61 -0
- rag_eval_kit_avan-0.1.0/rag_eval_kit_avan.egg-info/SOURCES.txt +10 -0
- rag_eval_kit_avan-0.1.0/rag_eval_kit_avan.egg-info/dependency_links.txt +1 -0
- rag_eval_kit_avan-0.1.0/rag_eval_kit_avan.egg-info/requires.txt +3 -0
- rag_eval_kit_avan-0.1.0/rag_eval_kit_avan.egg-info/top_level.txt +1 -0
- rag_eval_kit_avan-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Avan Kumar J
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rag-eval-kit-avan
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A lightweight Python wrapper for evaluating RAG pipelines using Ragas.
|
|
5
|
+
Author-email: Avan Kumar J <avankumar2025@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/avankumar2001/eval-rag-system
|
|
8
|
+
Project-URL: Repository, https://github.com/avankumar2001/eval-rag-system
|
|
9
|
+
Keywords: rag,llm,evaluation,ragas,langchain
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: ragas
|
|
14
|
+
Requires-Dist: datasets
|
|
15
|
+
Requires-Dist: langchain
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# rag-eval-kit-avan
|
|
19
|
+
|
|
20
|
+
A lightweight Python wrapper for evaluating RAG (Retrieval-Augmented Generation) pipelines using [Ragas](https://github.com/explodinggradients/ragas).
|
|
21
|
+
|
|
22
|
+
If you've built a RAG system with LangChain, LlamaIndex, or plain Python, you know that "it works" is not enough. You need to measure **Faithfulness**, **Answer Relevancy**, **Context Precision**, and **Context Recall**. This package wraps those Ragas metrics into a single function call.
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install rag-eval-kit-avan
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from rag_eval_kit import evaluate_rag
|
|
34
|
+
|
|
35
|
+
questions = ["What is RAG?", "What is a vector database?"]
|
|
36
|
+
answers = [
|
|
37
|
+
"RAG stands for Retrieval-Augmented Generation.",
|
|
38
|
+
"A vector database stores embeddings for similarity search.",
|
|
39
|
+
]
|
|
40
|
+
contexts = [
|
|
41
|
+
["RAG is a technique that combines retrieval with generation..."],
|
|
42
|
+
["Vector databases like FAISS and ChromaDB store high-dimensional vectors..."],
|
|
43
|
+
]
|
|
44
|
+
ground_truths = [
|
|
45
|
+
"RAG stands for Retrieval-Augmented Generation.",
|
|
46
|
+
"A vector database stores embeddings and supports similarity search.",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
results = evaluate_rag(questions, answers, contexts, ground_truths)
|
|
50
|
+
print(results)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Why This Exists
|
|
54
|
+
|
|
55
|
+
Most RAG tutorials stop at "here's how to build a chain." Nobody tells you how to **prove** your RAG pipeline is actually working. This package makes it a one-liner.
|
|
56
|
+
|
|
57
|
+
Built as part of an [Eval-First RAG System](https://eval-rag-system.streamlit.app) project.
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
MIT
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# rag-eval-kit-avan
|
|
2
|
+
|
|
3
|
+
A lightweight Python wrapper for evaluating RAG (Retrieval-Augmented Generation) pipelines using [Ragas](https://github.com/explodinggradients/ragas).
|
|
4
|
+
|
|
5
|
+
If you've built a RAG system with LangChain, LlamaIndex, or plain Python, you know that "it works" is not enough. You need to measure **Faithfulness**, **Answer Relevancy**, **Context Precision**, and **Context Recall**. This package wraps those Ragas metrics into a single function call.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install rag-eval-kit-avan
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from rag_eval_kit import evaluate_rag
|
|
17
|
+
|
|
18
|
+
questions = ["What is RAG?", "What is a vector database?"]
|
|
19
|
+
answers = [
|
|
20
|
+
"RAG stands for Retrieval-Augmented Generation.",
|
|
21
|
+
"A vector database stores embeddings for similarity search.",
|
|
22
|
+
]
|
|
23
|
+
contexts = [
|
|
24
|
+
["RAG is a technique that combines retrieval with generation..."],
|
|
25
|
+
["Vector databases like FAISS and ChromaDB store high-dimensional vectors..."],
|
|
26
|
+
]
|
|
27
|
+
ground_truths = [
|
|
28
|
+
"RAG stands for Retrieval-Augmented Generation.",
|
|
29
|
+
"A vector database stores embeddings and supports similarity search.",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
results = evaluate_rag(questions, answers, contexts, ground_truths)
|
|
33
|
+
print(results)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Why This Exists
|
|
37
|
+
|
|
38
|
+
Most RAG tutorials stop at "here's how to build a chain." Nobody tells you how to **prove** your RAG pipeline is actually working. This package makes it a one-liner.
|
|
39
|
+
|
|
40
|
+
Built as part of an [Eval-First RAG System](https://eval-rag-system.streamlit.app) project.
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
MIT
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "rag-eval-kit-avan"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A lightweight Python wrapper for evaluating RAG pipelines using Ragas."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Avan Kumar J", email = "avankumar2025@gmail.com"}
|
|
14
|
+
]
|
|
15
|
+
keywords = ["rag", "llm", "evaluation", "ragas", "langchain"]
|
|
16
|
+
dependencies = [
|
|
17
|
+
"ragas",
|
|
18
|
+
"datasets",
|
|
19
|
+
"langchain",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
[project.urls]
|
|
23
|
+
Homepage = "https://github.com/avankumar2001/eval-rag-system"
|
|
24
|
+
Repository = "https://github.com/avankumar2001/eval-rag-system"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from ragas import evaluate
|
|
2
|
+
from ragas.metrics import faithfulness, answer_relevancy, context_precision, context_recall
|
|
3
|
+
from datasets import Dataset
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def evaluate_rag(questions, answers, contexts, ground_truths):
|
|
7
|
+
"""
|
|
8
|
+
Evaluate a RAG pipeline using Ragas.
|
|
9
|
+
|
|
10
|
+
Args:
|
|
11
|
+
questions (list): List of question strings.
|
|
12
|
+
answers (list): List of answer strings generated by your RAG pipeline.
|
|
13
|
+
contexts (list): List of lists of retrieved context strings.
|
|
14
|
+
ground_truths (list): List of ground truth answer strings.
|
|
15
|
+
|
|
16
|
+
Returns:
|
|
17
|
+
dict: A dictionary with Faithfulness, Answer Relevancy,
|
|
18
|
+
Context Precision, and Context Recall scores.
|
|
19
|
+
"""
|
|
20
|
+
data = {
|
|
21
|
+
"question": questions,
|
|
22
|
+
"answer": answers,
|
|
23
|
+
"contexts": contexts,
|
|
24
|
+
"ground_truth": ground_truths,
|
|
25
|
+
}
|
|
26
|
+
dataset = Dataset.from_dict(data)
|
|
27
|
+
|
|
28
|
+
result = evaluate(
|
|
29
|
+
dataset=dataset,
|
|
30
|
+
metrics=[faithfulness, answer_relevancy, context_precision, context_recall],
|
|
31
|
+
)
|
|
32
|
+
return result
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rag-eval-kit-avan
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A lightweight Python wrapper for evaluating RAG pipelines using Ragas.
|
|
5
|
+
Author-email: Avan Kumar J <avankumar2025@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/avankumar2001/eval-rag-system
|
|
8
|
+
Project-URL: Repository, https://github.com/avankumar2001/eval-rag-system
|
|
9
|
+
Keywords: rag,llm,evaluation,ragas,langchain
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: ragas
|
|
14
|
+
Requires-Dist: datasets
|
|
15
|
+
Requires-Dist: langchain
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# rag-eval-kit-avan
|
|
19
|
+
|
|
20
|
+
A lightweight Python wrapper for evaluating RAG (Retrieval-Augmented Generation) pipelines using [Ragas](https://github.com/explodinggradients/ragas).
|
|
21
|
+
|
|
22
|
+
If you've built a RAG system with LangChain, LlamaIndex, or plain Python, you know that "it works" is not enough. You need to measure **Faithfulness**, **Answer Relevancy**, **Context Precision**, and **Context Recall**. This package wraps those Ragas metrics into a single function call.
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install rag-eval-kit-avan
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from rag_eval_kit import evaluate_rag
|
|
34
|
+
|
|
35
|
+
questions = ["What is RAG?", "What is a vector database?"]
|
|
36
|
+
answers = [
|
|
37
|
+
"RAG stands for Retrieval-Augmented Generation.",
|
|
38
|
+
"A vector database stores embeddings for similarity search.",
|
|
39
|
+
]
|
|
40
|
+
contexts = [
|
|
41
|
+
["RAG is a technique that combines retrieval with generation..."],
|
|
42
|
+
["Vector databases like FAISS and ChromaDB store high-dimensional vectors..."],
|
|
43
|
+
]
|
|
44
|
+
ground_truths = [
|
|
45
|
+
"RAG stands for Retrieval-Augmented Generation.",
|
|
46
|
+
"A vector database stores embeddings and supports similarity search.",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
results = evaluate_rag(questions, answers, contexts, ground_truths)
|
|
50
|
+
print(results)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Why This Exists
|
|
54
|
+
|
|
55
|
+
Most RAG tutorials stop at "here's how to build a chain." Nobody tells you how to **prove** your RAG pipeline is actually working. This package makes it a one-liner.
|
|
56
|
+
|
|
57
|
+
Built as part of an [Eval-First RAG System](https://eval-rag-system.streamlit.app) project.
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
MIT
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
rag_eval_kit/__init__.py
|
|
5
|
+
rag_eval_kit/evaluator.py
|
|
6
|
+
rag_eval_kit_avan.egg-info/PKG-INFO
|
|
7
|
+
rag_eval_kit_avan.egg-info/SOURCES.txt
|
|
8
|
+
rag_eval_kit_avan.egg-info/dependency_links.txt
|
|
9
|
+
rag_eval_kit_avan.egg-info/requires.txt
|
|
10
|
+
rag_eval_kit_avan.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rag_eval_kit
|