Add your description here
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
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
Evaluation
Important: When using the evaluate functions, ensure that the prediction and ground truth values are strings, not numerical labels.
The module offers comprehensive evaluation functions:
# Evaluate on in-domain test set
results = gqr.evaluate(
predictions=pred_id_labels,
ground_truth=true_id_labels
)
# Evaluate on out-of-domain test set
ood_results = gqr.evaluate(
predictions=pred_ood_labels,
ground_truth=true_ood_labels
)
# Evaluate by dataset (grouped evaluation)
dataset_results = gqr.evaluate_by_dataset(
ood_test_data,
pred_col='pred',
true_col='true',
dataset_col='dataset'
)
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gqr-0.0.2.tar.gz.
File metadata
- Download URL: gqr-0.0.2.tar.gz
- Upload date:
- Size: 106.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a79f8db76a4f313b5c601d16fe3cdfe7b37c097cb8e768bd09663e0f46968584
|
|
| MD5 |
ad2435e8ecb5b6e622f411970504137b
|
|
| BLAKE2b-256 |
4d383244288168654e9fe4111e043fcedf5da89925dd33da8f99acaa0be08297
|
File details
Details for the file gqr-0.0.2-py3-none-any.whl.
File metadata
- Download URL: gqr-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
523c27ac9e32f2fc13d45205ccc07afb59cce95c5cd0fac86de9b7695570f722
|
|
| MD5 |
c2654603cd2a09d3a488664b2cdb0c5c
|
|
| BLAKE2b-256 |
9641db1b90a33fea8599f687224dce4d3dd208e0300468ce3919fd5f1e361cf2
|