Skip to main content

Lightweight evaluation metrics for RAG (Hit@k, Recall@k, Precision@k, MRR, nDCG, and more)

Project description

rag-eval-lite

Lightweight retrieval evaluation metrics for RAG systems.


Install

pip install rag-eval-lite

Usage

from rag_eval import evaluate_dataset

results = evaluate_dataset(data, k=3)
print(results)

Input Format

Each item in data must be:

{
  "question": "string",
  "golden_chunk_ids": ["chunk_1"],
  "retrieved_chunk_ids": ["chunk_1", "chunk_3", "chunk_7"]
}
  • golden_chunk_ids: ground truth relevant chunks
  • retrieved_chunk_ids: retriever output (ordered by rank)

Output

{
  "hit@k": float,
  "precision@k": float,
  "recall@k": float,
  "mrr": float,
  "ndcg@k": float,
  "num_failures": int,
  "failures": [...]
}

Notes

  • Order of retrieved chunks matters
  • Supports single and multi-chunk evaluation
  • Failures include full debug info

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

rag_eval_lite-0.1.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rag_eval_lite-0.1.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file rag_eval_lite-0.1.2.tar.gz.

File metadata

  • Download URL: rag_eval_lite-0.1.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for rag_eval_lite-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1a8a0aa39c17a9d1942613b30bc34cba4ba7adafe15ea293af6d2b17abfb040d
MD5 013347bcc1d3040c5090c6d227a97fcf
BLAKE2b-256 7f31867faa5c55907cf7eec34cc49ad732b335833e0944c16c9e2ef4d1ae0354

See more details on using hashes here.

File details

Details for the file rag_eval_lite-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: rag_eval_lite-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for rag_eval_lite-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 76e326099396e3b248b772510dacb025d19e5fcdd24338e2c12de49124e97fa4
MD5 b733ee4cfe8349690fc8a692eeff6f17
BLAKE2b-256 168ba2f3e631a169369a472b112644bbd7aa041c9ef9a7bb1a2aa872a7122519

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page