A library for evaluating Retrieval-Augmented Generation (RAG) systems
4
stars
7
commits
Python
primary language
May 22, 2024
updated
RAG Evaluator is a Python library for evaluating Retrieval-Augmented Generation (RAG) systems. It provides various metrics to evaluate the quality of generated text against reference text.
You can install the library using pip:
pip install rag-evaluator
Here's how to use the RAG Evaluator library:
from rag_evaluator import RAGEvaluator
# Initialize the evaluator
evaluator = RAGEvaluator()
# Input data
question = "What are the causes of climate change?"
response = "Climate change is caused by human activities."
reference = "Human activities such as burning fossil fuels cause climate change."
# Evaluate the response
metrics = evaluator.evaluate_all(question, response, reference)
# Print the results
print(metrics)
To run the web app:
streamlit run app.py
The following metrics are provided by the library:
To run the tests, use the following command:
python -m unittest discover -s rag_evaluator -p "test_*.py"
7 commits
Python
100.0%
A library for evaluating Retrieval-Augmented Generation (RAG) systems
4
stars
7
commits
Python
primary language
May 22, 2024
updated
RAG Evaluator is a Python library for evaluating Retrieval-Augmented Generation (RAG) systems. It provides various metrics to evaluate the quality of generated text against reference text.
You can install the library using pip:
pip install rag-evaluator
Here's how to use the RAG Evaluator library:
from rag_evaluator import RAGEvaluator
# Initialize the evaluator
evaluator = RAGEvaluator()
# Input data
question = "What are the causes of climate change?"
response = "Climate change is caused by human activities."
reference = "Human activities such as burning fossil fuels cause climate change."
# Evaluate the response
metrics = evaluator.evaluate_all(question, response, reference)
# Print the results
print(metrics)
To run the web app:
streamlit run app.py
The following metrics are provided by the library:
To run the tests, use the following command:
python -m unittest discover -s rag_evaluator -p "test_*.py"
7 commits
Python
100.0%