Skip to main content

Retrieve and Evaluate with X(any) models

Project description

x.retrieval

Retrieve and evaluate with X (any) models.

This project simplifies automated text-image retrieval benchmarks.

Inputs:

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

Outputs:

  • 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

import xretrieval

xretrieval.run_benchmark(
    dataset_name="coco-val-2017",
    model_id="transformers/Salesforce/blip2-itm-vit-g",
    mode="text-to-text",
)

Output:

{
    'MRR': 0.2953,
    'NormalizedDCG': 0.3469,
    'Precision': 0.2226,
    'Recall': 0.4864,
    'HitRate': 0.4864,
    'MAP': 0.2728
}

๐Ÿ“ฆ Installation

pip install xretrieval

๐Ÿ› ๏ธ Usage

List datasets:

xretrieval.list_datasets()

List models:

xretrieval.list_models()

๐Ÿงฐ Supported Models and Datasets

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       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Datasets:

  • coco-val-2017

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.0.tar.gz (3.9 MB view details)

Uploaded Source

Built Distribution

xretrieval-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xretrieval-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4206cf275b3d57f75c6981403d69b33aefe14e8b69afddd17b25facefbd73632
MD5 497b464d99652a1775ea35c7b3e7ed66
BLAKE2b-256 897edaec602f25ba77811c59d46475cea3445230572b6d955adb145ae949f515

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xretrieval-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4889de9ad4eb122252ee964bf0468c4316b10b7dee6e38fbce4fc9cc53158aab
MD5 e34f8dae7e5486cd6587d179b8ede947
BLAKE2b-256 1092bf6e5ca28f2c6731ae08332b81cdd19a098ddabb501b212dfac1eeae3832

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