Skip to main content

Package for Guarded Query Routing Benchmark (GQR-Bench)

Project description

GQR-Bench (Guarded Query Routing Benchmark)

A benchmark and evaluation toolkit for developing and testing guarded query routing models for AI systems.

Installation

pip install gqr

Quick Start

import gqr

# Load development dataset for initial experimentation
dev_train_data, dev_eval_data = gqr.load_dev_dataset()

# Load training dataset for model development
train_data, eval_data = gqr.load_train_dataset()

# Load test datasets for final evaluation
domain_test_data = gqr.load_id_test_dataset()  # In-domain test data
ood_test_data = gqr.load_ood_test_dataset()    # Out-of-domain test data

# Score the model on gqr-bench
def scoring_function(text: str) -> int:
    # Scoring function takes text input (str) and returns predicted domain label (int)
    # Implement your classification logic here
    return 0  # Replace with actual domain prediction

# Evaluate model performance
score = gqr.score(scoring_function)

Domain Labels

The repository provides mappings between numerical labels and domain names:

# Get label mappings
print(gqr.label2domain)  # Maps numerical labels to domain names
print(gqr.domain2label)  # Maps domain names to numerical labels

Score

import gqr

def scoring_function(text: str) -> int:
    # Scoring function takes text input (str) and returns predicted domain label (int)
    # Implement your classification logic here
    return 0  # Replace with actual domain prediction

# Evaluate model performance
score = gqr.score(scoring_function)

Contributing

git clone git@github.com:williambrach/gqr.git
uv venv --python 3.12
uv sync 

Paper and Citations

If you use GQR-Bench in your research, please cite our paper:

Contributing

Contributions to GQR-Bench are welcome! Please feel free to submit a Pull Request with improvements, additional evaluation metrics, or dataset enhancements.

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

gqr-0.0.5a0.tar.gz (106.6 kB view details)

Uploaded Source

Built Distribution

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

gqr-0.0.5a0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file gqr-0.0.5a0.tar.gz.

File metadata

  • Download URL: gqr-0.0.5a0.tar.gz
  • Upload date:
  • Size: 106.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.17

File hashes

Hashes for gqr-0.0.5a0.tar.gz
Algorithm Hash digest
SHA256 3b736e98e818c92d5a7ca79549b9dba5daa8e7011d214cb2ca591241a18c5b76
MD5 13267856b258dc48b96122e82ac31226
BLAKE2b-256 119bed0ba05802708e7aa74b977173fa047616d10eeaeca78d1a5462331e5a5c

See more details on using hashes here.

File details

Details for the file gqr-0.0.5a0-py3-none-any.whl.

File metadata

  • Download URL: gqr-0.0.5a0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.17

File hashes

Hashes for gqr-0.0.5a0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d257dcb829667b08a6ab4af124150159d58fdd3f9cf1655ee675701c710a50b
MD5 f4b1c876ccb171d8abe0888a1e9a2552
BLAKE2b-256 1a2d1d331c07bb2c9de6f90281b1b2a5cd86b95d12d1b2698c927b5ae8c5a46e

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