BIBRA-Eval
Evaluating descriptive cataloguing records created with BIBRA.
BIBRA is an (L)LM-based assistance
tool, to generate bibliographic metadata from a given PDF-Input.
BIBRA-Eval provides tooling to make direct comparisons of
LLM-generated BIBRA JSON-Records with gold-standard records coming from
a different source (e.g. manual indexing). It validates records against a
Pydantic schema, scores configured fields, and summarizes precision, recall,
and F1 with document, field, or micro averaging. Its comparison matrix also
supports stratified drill-downs.
Installation
From a checkout of this package, install it into the active environment:
uv pip install -e .
The package requires Python 3.11 or newer. Import the public API with
import bibraeval; no bibra-eval command-line interface is currently
provided.
Quick start
Prepare two datasets with matching document IDs, then pass their paths and a
Pydantic metadata model to Evaluator:
from pydantic import BaseModel
from bibraeval import Evaluator
class PublicationMetadata(BaseModel):
title: str | None = None
year: str | None = None
result = Evaluator(
"data/gold.jsonl",
"data/predictions.jsonl",
PublicationMetadata,
).compute_metrics()
print(result)
By default, every schema field is compared with exact matching and uniform
weight. Evaluator defaults to field-avg; set mode to doc-avg or
micro-avg to choose another aggregation. The result is a Polars DataFrame
with one row per metric and metric, mode, value, and support columns.
Inputs and matching
Each input can be a directory of JSON files or a JSONL file. Directory
filenames (without .json) are document IDs; JSONL records require a non-empty
string doc_id property. Remaining values are validated by the supplied
Pydantic model. IDs must match across datasets by default. Set
drop_mismatched_doc_ids=True to evaluate only the IDs present on both sides.
Field metrics
Configure fields with FieldMetricMapping or a dictionary/YAML file. Supported
metrics are exact and levenshtein; each field may also have a positive
weight and list comparison mode (all-of or any-of). Levenshtein
configuration requires a match_threshold between 0 and 1 for aligning list
items. Scalar Levenshtein scores are similarity ratios and are not cut off by
that list-alignment threshold.
Documentation
Start with the documentation start page for focused guides and the
generated API reference. See the
architecture guide for a complete class diagram
for developers.
To build the Sphinx site, install the docs dependency group and run
sphinx-build -W -b html docs docs/_build/html from this directory. See
docs/README.md for the exact local setup commands.
Disclaimer
This project was constructed under assistance of Github Copilot. While the class hierarchy and overall software specification comes from the developers, AI assistance was used to generate code, tests and documentation. All AI generated content has been reviewed line by line and the authors take full responsibility for the generated code (AI:AMBER following the AI Traffic Lights Protocol by Nila Löber).
Metadata
Release files for bibraeval 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bibraeval-0.1.0.tar.gz | 28.9 kB | With provenance | Details for bibraeval-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bibraeval-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for bibraeval-0.1.0-py3-none-any.whl |
Total release size: 51.4 kB
Release files / bibraeval-0.1.0.tar.gz
| Download URL | bibraeval-0.1.0.tar.gz |
|---|---|
| Size | 28.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54ef49a2f1773da7ae6f5e63bf05f6c37b613d9526de02e165fa574184826b9a
|
|
BLAKE2b-256 checksum How to use checksums |
6f86bdae40ac83a08960db4aaea19e608f3d68f483f8232afbc45b6b5a4fc968
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 10, 2026.
Transparency logRelease files / bibraeval-0.1.0-py3-none-any.whl
| Download URL | bibraeval-0.1.0-py3-none-any.whl |
|---|---|
| Size | 22.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
280cedcc31ca84cfd53ec3b165a831fc203465c4a63b6f53d94a173d2c2073dc
|
|
BLAKE2b-256 checksum How to use checksums |
89e1accd4abad3dc295c66d44fbf9bd76460c67797d083118a7fd79351e5cab4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 10, 2026.
Transparency logSecurity for bibraeval 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.
Attestation for bibraeval-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 10, 2026.
Transparency logA 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.