Skip to main content

Python package for evaluation of retrieval-augmented generation (RAG) models

Project description

Indomee

Indomee is a Python package designed to simplify the evaluation of retrieval-augmented generation (RAG) models and other retrieval-based systems. With indomee, you can compute common evaluation metrics like recall and mean reciprocal rank (MRR) at various levels of k, all through a straightforward API.

We also provide support for simple bootstrapping at the moment with t-testing coming soon.

Installation

pip install indomee

You can get started with indomee with the following example

Indomee provides functions to calculate various metrics such as Mean Reciprocal Rank (MRR) and Recall.

Example Usage

from indomee import calculate_mrr, calculate_recall, calculate_metrics_at_k

mrr = calculate_mrr([1, 2, 3], [2, 3, 4])
print("MRR:", mrr)
# > MRR: 0.5

# Calculate Recall
recall = calculate_recall([1, 2, 3], [2])
print("Recall:", recall)
# > Recall: 1

# Calculate metrics at specific k values
metrics = calculate_metrics_at_k(
    metrics=["recall"], preds=[1, 2, 3], labels=[2], k=[1, 2, 3]
)
print("Metrics at k:", metrics)
# > {'recall@1': 0.0, 'recall@2': 1.0, 'recall@3': 1.0}

2. Bootstrapping

Indomee also supports bootstrapping for more robust metric evaluation.

Example Usage

from indomee import bootstrap_sample, bootstrap

# Bootstrapping a sample
result = bootstrap_sample(preds=[["a", "b"], ["c", "d"], ["e", "f"]], labels=[["a", "b"], ["c", "d"], ["e", "f"]], n_samples=10, metrics=["recall"], k=[1, 2, 3])
print("Bootstrap Sample Metrics:", result.sample_metrics)

# Bootstrapping multiple samples
result = bootstrap(preds=[["a", "b"], ["c", "d"], ["e", "f"]], labels=[["a", "b"], ["c", "d"], ["e", "f"]], n_samples=10, n_iterations=10, metrics=["recall"], k=[1, 2, 3])
print("Bootstrap Metrics:", result.sample_metrics)

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

indomee-0.1.2.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

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

indomee-0.1.2-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: indomee-0.1.2.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for indomee-0.1.2.tar.gz
Algorithm Hash digest
SHA256 41d2192a39ac0b63b9b0045806578995346ab2c61322f9b031edd3aa291d1c62
MD5 43bfe4b6cf7b208819e8c60120c75fea
BLAKE2b-256 6b6c95ede4d2c100864c136b54f5df4a0951435b54d1caef932404f98d26d8e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for indomee-0.1.2.tar.gz:

Publisher: release.yml on ivanleomk/indomee

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: indomee-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for indomee-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a60469b2d17b9b06dd710dd1d4db27a486d287a8161d458b94204cd7a4490a53
MD5 6d2fdc6db6fb957015f6478922f9661b
BLAKE2b-256 a0e018341c49205b90aad4918c2df2bb0777363918e0f458e5761a165d61e7ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for indomee-0.1.2-py3-none-any.whl:

Publisher: release.yml on ivanleomk/indomee

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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