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.5.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.5-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gqr-0.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 4c730515555287b02afe8be0411d3097a960cf4287867cd5f9508a6fece0c810
MD5 1e3114412ea41f9a2583ec4d4887794f
BLAKE2b-256 0bfec824e24c348e1d1f031464badf21ce11cd7e77a191edf4644d0258603fa2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gqr-0.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e0821ac35fe0ffb30e895501c85911bdd8db1fc68634061f5d40146444f4983b
MD5 2c063cea2a72db791dc29915062c33f4
BLAKE2b-256 2c4717a904754bccc0f65b7c59e6a2762f35b946a46aa2671bd8e08092b6ea51

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