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.4.tar.gz (106.5 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.4-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file gqr-0.0.4.tar.gz.

File metadata

  • Download URL: gqr-0.0.4.tar.gz
  • Upload date:
  • Size: 106.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for gqr-0.0.4.tar.gz
Algorithm Hash digest
SHA256 39945bfbedf170bfc3848280b50ae054e1c4188e11bd353175ccd422f8051de8
MD5 628efffac19596f413c517389614d439
BLAKE2b-256 0818114b1c1c8a6cbbc671ff9ec082db10171b542a25ee30d51fe5cb5741e3e0

See more details on using hashes here.

File details

Details for the file gqr-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: gqr-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for gqr-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b92c4077f40be5b350d250331955e13b1623fb5fb8da75a162706119243cb6bb
MD5 ab8b07ccb0e883c82269b3c71b854e3f
BLAKE2b-256 8ce92d82c0501756911fd862d64cb60514c5c7f8c7cd1bb76fc3c4e0f046a53c

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