Skip to main content

groupval

Validate language model labels within each group before comparing groups.

Language model labels can be accurate overall and still err more on one group's texts, which biases any comparison between groups. On the congressional tweets of Gilardi, Alizadeh and Kubli (2023), coders with accuracy near 0.87 overstate the Democrat minus Republican gap in political content by more than four times, because they miss more Republican political tweets. groupval reports sensitivity, specificity and error for each group, the bias in the between-group gap with an interval clustered by author, and the number of expert labels each group needs to estimate that bias to a chosen precision.

Install

pip install git+https://github.com/Nyxius-Labs/groupval

Use

from groupval import validate, plan_gold

r = validate(labels, gold, group, cluster=author, reference="D")
r.per_group
r.bias, r.interval
plan_gold(r.variance_by_group["D"], r.variance_by_group["R"], halfwidth=0.03)

labels and gold are 0/1 arrays on the expert-labeled items, group holds the two groups being compared and cluster the author or account. python examples/simulate.py runs a small simulated case.

Reference

Crainic, J., and Yee, B. Accurate Overall, Biased Between Parties: Validating Language Model Labels Within Each Group. Extended abstract, 2026.

License

MIT

Metadata

Release files for groupval 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for groupval 0.1.0
File Size Uploaded Provenance Actions
groupval-0.1.0.tar.gz 3.8 kB With provenance Details for groupval-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for groupval 0.1.0
File Interpreter ABI Platform Actions
groupval-0.1.0-py3-none-any.whl Python 3 none any Details for groupval-0.1.0-py3-none-any.whl

Total release size: 7.6 kB

Release files / groupval-0.1.0.tar.gz

Download URL groupval-0.1.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
480890a5c540650a02efd54f63282bf7e1bd02e08418f63e3b49fc6aa38fd48d
BLAKE2b-256 checksum
How to use checksums
58b1fc7c94b72eb3852e46c04dfce57c33dd46722a503b932b1e267885fed2fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / groupval-0.1.0-py3-none-any.whl

Download URL groupval-0.1.0-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96598ed3ef5078152fd67ca96c9a7a6e61a7b8b93d6d4f7b981e201d2d78745a
BLAKE2b-256 checksum
How to use checksums
9c59cb64261c6ad499a28e1ee6a8231e267b20dedba4175e7351de90906b0e8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for groupval 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for groupval-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page