No project description provided
Project description
RAG Evaluator
Overview
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.
Installation
You can install the library using pip:
pip install rag-evaluate Usage Here's how to use the RAG Evaluator library:
from rag_evaluate import RAG_Evaluator
Initialize the evaluator
evaluator = RAG_Evaluator()
Input data
question = "What are the causes of climate change?" generated_text = "Climate change is caused by human activities." context = "Human activities such as burning fossil fuels cause climate change."
Evaluate the response
bleu_score = evaluator.bleu_score(question, response, reference) rouge_score = evaluator.rouge_score(question, response, reference) bert_score = evaluator.bert_score(question, response, reference)
Print the results
print(bleu_score) print(rouge_score) print(bert_score)
The RAG Evaluator provides the following metrics:
BLEU (0-100): Measures the overlap between the generated output and reference text based on n-grams.
0-20: Low similarity, 20-40: Medium-low, 40-60: Medium, 60-80: High, 80-100: Very high
ROUGE-1 (0-1): Measures the overlap of unigrams between the generated output and reference text.
0.0-0.2: Poor overlap, 0.2-0.4: Fair, 0.4-0.6: Good, 0.6-0.8: Very good, 0.8-1.0: Excellent
BERT Score (0-1): Evaluates the semantic similarity using BERT embeddings (Precision, Recall, F1).
0.0-0.5: Low similarity, 0.5-0.7: Moderate, 0.7-0.8: Good, 0.8-0.9: High, 0.9-1.0: Very high
Contributer
Biplab Sil
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rag_evaluate-0.2.0.tar.gz.
File metadata
- Download URL: rag_evaluate-0.2.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7cf3408fb023c83711d8fae1434b800509b9692f01f249f36a7d2bfa5d7a374
|
|
| MD5 |
157e289798ea1bcefd8110f3957ecf16
|
|
| BLAKE2b-256 |
96ff5897b69350bca36199fb7023dec0a013004a9bd76d908b2042501d77fa9b
|
File details
Details for the file rag_evaluate-0.2.0-py3-none-any.whl.
File metadata
- Download URL: rag_evaluate-0.2.0-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd1aee01d861e2e49ca87233574a60ebda13a7373960f97c58390c63ba53c0f6
|
|
| MD5 |
e324b51d81569174dba1d0a085684c8a
|
|
| BLAKE2b-256 |
0190fc33d9f32e2e349aa0e0f9127f744f3f71ba8b1f1f1628dd7a6ae56eaf14
|