Skip to main content

Retrieve and Evaluate with X(any) models

Project description

Python PyPI version Downloads License

Evaluate your multimodal retrieval system with any models and datasets.

Specific inputs:

  • A dataset
  • A model
  • A mode (e.g. image-to-image)

Get evaluation metrics:

  • A retrieval results dataframe
  • A retrieval metrics dataframe

🌟 Key Features

  • ✅ Supports a wide range of models and datasets.
  • ✅ Installation in one line.
  • ✅ Run benchmarks with one function call.

🚀 Quickstart

Open In Colab Open In Kaggle

import xretrieval

metrics, results_df = xretrieval.run_benchmark(
    dataset="coco-val-2017",
    model_id="transformers/Salesforce/blip2-itm-vit-g",
    mode="text-to-text",
)
    Retrieval Metrics     
┏━━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ Metric         Score  ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━┩
│ MRR            0.3032 │
│ NormalizedDCG  0.3497 │
│ Precision      0.2274 │
│ Recall         0.4898 │
│ HitRate        0.4898 │
│ MAP            0.2753 │
└───────────────┴────────┘

📦 Installation

pip install xretrieval

🛠️ Usage

List datasets:

xretrieval.list_datasets()
                    Available Datasets                     
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Dataset Name   Description                             ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ coco-val-2017  The COCO Validation Set with 5k images. │
└───────────────┴─────────────────────────────────────────┘

List models:

xretrieval.list_models()
                         Available Models                         
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ Model ID                                          Model Input ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ transformers/Salesforce/blip2-itm-vit-g           text-image  │
│ transformers/Salesforce/blip2-itm-vit-g-text      text        │
│ transformers/Salesforce/blip2-itm-vit-g-image     image       │
│ sentence-transformers/paraphrase-MiniLM-L3-v2     text        │
│ sentence-transformers/paraphrase-albert-small-v2  text        │
│ sentence-transformers/multi-qa-distilbert-cos-v1  text        │
│ sentence-transformers/all-MiniLM-L12-v2           text        │
│ sentence-transformers/all-distilroberta-v1        text        │
│ sentence-transformers/multi-qa-mpnet-base-dot-v1  text        │
│ sentence-transformers/all-mpnet-base-v2           text        │
│ sentence-transformers/multi-qa-MiniLM-L6-cos-v1   text        │
│ sentence-transformers/all-MiniLM-L6-v2            text        │
│ timm/resnet18.a1_in1k                             image       │
└──────────────────────────────────────────────────┴─────────────┘

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

xretrieval-0.1.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

xretrieval-0.1.1-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file xretrieval-0.1.1.tar.gz.

File metadata

  • Download URL: xretrieval-0.1.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for xretrieval-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a7bd58482c0769374c7990fe4c10876036a6b860d1007b74878bfc5218e160fc
MD5 b5c19adba52b2ba96bf085b3743d07b8
BLAKE2b-256 a8b3bc5906f49872e3d16cb480f4c14c28105ec16bbc377c4e9a9a74e977f469

See more details on using hashes here.

File details

Details for the file xretrieval-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: xretrieval-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for xretrieval-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4ddc45cfac26c115459d62dcea9633e16f7f9a760745b826bda584e0d430bee7
MD5 59211b02b9708560febe4d3b74c6430b
BLAKE2b-256 183afca5347bd1eeecafc635db5281a56469c327577fdeb64c3d3eb5fdb2f7ce

See more details on using hashes here.

Supported by

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