Evidence Citations
Verify which cell a numerical claim cites in a PDF table. Evidence Citations uses the positions of printed words to find the entry named by a row and heading. It runs on a CPU and compares the claimed value only after selecting the cell.
PDF table verification is the primary focus, standalone or inside a RAG pipeline, with additional rule-based verification for plain-text answers. One deterministic engine serves three uses, without calling another model:
- Standalone table verification. Check a numerical claim against the printed table cell it names, with no language model involved.
- RAG verification. When an LLM answer cites a PDF table, check each table number against the cited page before the answer is shown. See the RAG table example.
- Plain-text checks, as an extra. Rule-based checks of quotations, values, negation and wording for text sources. They have not been benchmarked, and general semantic entailment (NLI) is not supported. See the plain-text examples.
The three blind panels measured cell attribution for supplied table claims, not end-to-end RAG answer quality.
Available on PyPI for Python 3.10 and later. One command installs the library with PDF support:
pip install evidence-citations
What it verifies · Verify RAG table answers · Check plain text · Run the PDF example · See the table lookup architecture · Compare all eight methods · Reproduce the comparison
Both systems approved 158. Both withheld approval when the claimed value was changed. Only one selected the cell marked by the independent XML reference. This recorded ICDAR development example is why the library keeps the word IDs behind a proposal: two identical verdicts can point a reader to two different places on a page.
What it verifies
| Capability | Entry point | Evidence and scope |
|---|---|---|
| Attribute a numerical claim to a printed table cell | CitationEngine(mode="strict") |
Evaluated on three blind panels of born-digital PDF tables. See the eight-arm comparison. |
| Check the table numbers in an LLM answer against the cited PDF cells | verify_answer in CitationEngine(mode="strict"), with parse_records and a registered PDF |
Uses the same table engine as the evaluation. The blind panels supplied the claims from annotations, not from model output. See the RAG table example. |
| Locate a quotation on its designated PDF page | CitationEngine(mode="strict") |
Part of the table evaluation. Standalone quotation location has no separate benchmark here. |
| Check a claim against an authorized text passage | CitationEngine(mode="text_only") |
Implemented. Examples below cover a changed amount, reversed negation, stronger wording and a missing quotation. Plain-text accuracy has not been benchmarked. |
| Link claims in an answer to citation records | verify_answer |
Implemented. Returns claim verdicts and reasons. The structured citation channel works with caller-supplied model output. |
| Check explicitly annotated claims and validity dates | verify_claims |
Implemented. The caller supplies claims, evidence links and any validity intervals or as-of date. |
| General paraphrase or semantic entailment (NLI) | — | Unsupported. The text verifier uses defined matching rules; it has no general-purpose model for deciding that two sentences mean the same thing. |
Table lookup architecture
How do you find the 2012 total when a PDF gives you words and coordinates, but no cell borders? The local verifier needs to resolve one row–column intersection. In this example from SEE’s 2012 financial statement, it uses the white space between amounts on nearby rows to establish the column.
- Find the row. The verifier locates the row label and the quotation in the passage the caller authorized on that page. If a label repeats, the quotation can distinguish the rows. The named heading determines which column to check.
- Build a virtual column from the print. For the body-gutter test, project the left and right edges of nearby body fragments onto the horizontal axis. Merge overlapping or closely spaced intervals. Here, a gap persists between the two groups of amounts across three peer rows. The green band shows the resulting horizontal span extended vertically so you can see that both 2012 and the first Total entry overlap it. The adjacent 2011 entry falls across the gap.
- Compare only after selection. The selected entry is
$4.6, PDF words 359 and 360. Changing the claim to$9.8leaves those IDs unchanged, even though$9.8is printed one column over. The first claim is approved and the second is withheld.
The body-gutter test is one way to establish a column. Aligned peer entries or a heading row with distinct matches can also support lookup. Grouped headings require a check of the named heading path. If the enabled routes cannot resolve a unique entry, the local verifier abstains.
Each proposal records word IDs for the row label, heading and value, plus group headings where available. The comparison treats ordinary numerals as printed, with declared display aliases, and recognized currency amounts as exact quantities with their qualifiers.
Inside the body-gutter test: geometry, tolerances and abstention
- The unit
his the median height of the row-label words. Starting at the cited entries’ baseline, the verifier collects nearby body lines. A large vertical gap (over3.5h) or a figure-free line with text spanning two entry centres stops the walk. - On a retained baseline, words less than
0.57hapart join the same run, measured from its covered right edge. The verifier projects eligible fragments onto the horizontal axis and joins intervals with a gap below0.5h. Eligible detached currency signs fold into an amount to their right and percent signs into an amount to their left. - Each entry of the cited row must meet exactly one span, and different entries must meet different spans. The heading’s horizontal extent must overlap only the proposed entry’s span. For a wrapped heading, at least one of its printed lines must overlap that span. Another body line must put ink in the selected span and in at least one other span.
- To check dependence on the crop, the verifier shifts the admission edges and the value cut together by up to
h/4. It checks the placements where a word crosses a limit, the endpoints and intervening midpoints. All placements must identify the same entry, and the best horizontal margin must reachh/50. If this test declines, other enabled selection routes may still supply evidence.
The figure redraws the horizontal marks from the study’s SEE 2012 example. When the body-gutter route was disabled in the development ablation, this claim lost its proposal. Across development panels, disabling it lost 39 positive approvals in 25 tables and gained one elsewhere. Column model · Local selector
Results and runtime
What we tested on
Development used ICDAR 2013 tables, SciTSR, Camelot test fixtures, and separate samples from FinTabNet and PubTables-1M.
Blind evaluation. We froze the verifier before testing all eight methods on the same three panels. Each panel holds out a different unit from verifier development. Sampling details and source references
| Panel | Source and documents | Source split | Held out from verifier development | Eligible plain positive claims |
|---|---|---|---|---|
| P1 | PubTables-1M · scientific articles | Structure test | Articles | 244 |
| P2 | FinTabNet · financial statements | Train | Issuer families | 114 |
| P3 | PubTables-1M · scientific articles | Validation | Journals outside the identified development set | 245 |
Eight methods on the same claims
Each panel column counts correct claims that were both approved and traced to the reference cell. The denominator includes every eligible plain positive claim, including abstentions.
| Method | P1 (244) | P2 (114) | P3 (245) | False approvals (1,497 controls) | Seconds/page (P1 / P2 / P3) |
|---|---|---|---|---|---|
| Local word geometry | 183 | 80 | 167 | 0 | 0.73 / 0.17 / 0.70 |
| Docling grid | 121 | 24 | 149 | 0 | 3.53 / 2.56 / 3.38 |
| Docling + local | 187 | 80 | 168 | 0 | 3.68 / 2.58 / 3.26 |
| PyMuPDF grid | 15 | 0 | 9 | 0 | 1.40 / 0.65 / 0.93 |
| PyMuPDF + local | 186 | 80 | 167 | 0 | 1.49 / 0.69 / 1.77 |
| TATR grid | 45 | 9 | 30 | 0 | 1.80 / 1.83 / 1.01 |
| TATR + local | 186 | 80 | 167 | 0 | 2.07 / 1.87 / 1.13 |
| Nearest-column baseline | 195 | 56 | 191 | 9 | 0.43 / 0.16 / 0.49 |
The false-approval column pools the separately scored, definitely false controls across panels: 718 same-row substitutions and 779 wrong-row requests. All nine false approvals by the nearest-column baseline were same-row substitutions. This distinction matters on P1 and P3, where that baseline also has the highest audited positive count. P1 report · P2 report · P3 report
Times are end-to-end medians from three rounds on the study machine. Local word geometry, PyMuPDF and nearest-column lookup ran on CPU. Docling and TATR times include GPU grid production. Model initialization is excluded. Timing data
Primary comparison: local word geometry versus the Docling grid
| Panel | Eligible claims | Local approved and audited | Docling grid approved and audited | Local minus Docling, percentage points [95% interval] |
|---|---|---|---|---|
| P1 · PubTables-1M works | 244 | 183 | 121 | +25.4 [+16.9, +34.2] |
| P2 · FinTabNet issuer families | 114 | 80 | 24 | +49.1 [+36.0, +62.3] |
| P2 · same targets, all selected row words | 114 | 66 | 21 | +39.5 [+26.4, +53.1] |
| P3 · PubTables-1M journal holdout | 245 | 167 | 149 | +7.3 [−2.5, +17.0] |
The primary P2 audit can exempt designated dot leaders outside a text-tight row-label box. The sensitivity includes every selected word. On P3 the interval includes zero. Design and panel definitions
What happens when a grid proposes a cell?
A grid supplies a reconstructed table. In the grid-only comparison, the verifier looks up the claim in that structure. The hybrid tries local lookup first and can also check a grid proposal against the printed row and heading. The Docling grid results below refer to our verifier using Docling’s table structure; the verifier issues the claim verdict.
On this correct claim from the P1 holdout, both proposals identified the right heading. The Docling-grid proposal took the row label and value from lower on the page. Its quotation could not be located for that proposal, so the verifier withheld approval. The local proposal passed all three coordinate checks and the claim was approved. Auditing proposed cells even on withheld claims makes this kind of error visible. P1 aggregate audit · Per-job research archive, restricted access
Try it on a PDF
After installation, download the standalone example as verify_cell.py and run python verify_cell.py. From a checkout, run python examples/verify_cell.py.
The example creates a temporary PDF, makes two claims about the yield at Site 2 and checks the same quotation for both. Expected output:
20 approved
82 withheld
For your own document, register the file with CitationEngine.register_pdf, pass the authorized passage as a Source with its one-based page number, and call verify_answer with the statement and quotation. Read result.citations for the verified location and result.claims for support. The local table mode is intended for born-digital PDFs with extractable word positions.
RAG answers that cite PDF tables
When an LLM answer takes a number from a PDF table, Evidence Citations can check it against the printed cell before the answer is shown. The engine runs after generation. It reads the model's answer, the model's citation records, and the passages and PDF pages your retriever authorized.
What the engine needs
| Input | Supplied by | How |
|---|---|---|
| The original PDF | Your application | engine.register_pdf(path, document_id="report"), once per file. The engine reads printed word positions from it. If your retriever converts tables to Markdown, keep the file and page. |
| Each retrieved passage | Your retriever | Source(id="report", parent_id=0, document_id="report", passage=text, segments=[Segment(text=text, page=1)]). Pages are one-based. Give each source its own id and parent_id. |
| The answer | The model | The visible answer text, passed to verify_answer. |
| One citation record per claim | The model | answer: the claim sentence exactly as it appears in the answer. source_id: one of your Source IDs. quote: the whole printed row, copied verbatim. page: the one-based page; it may be omitted only when the source covers a single page. |
| The table claim | The model | The <heading> for <row> is <value>. or For <row>, column <heading>, the table lists <value>. |
Add a table rule to the instructions you already give the model, for example:
from evidence_citations import generation_instructions
TABLE_RULE = ("When a number comes from a table, write that claim as "
"'The <column heading> for <row label> is <value>.' and quote the whole printed row.")
system_prompt = generation_instructions() + "\n" + TABLE_RULE
Example
examples/rag_table.py builds a one-page report whose North row prints 158 under both 2023 and 2024. It then verifies a saved answer with one claim in each form:
records = parse_records(CITATIONS_JSON)
with CitationEngine(mode="strict") as engine:
engine.register_pdf(path, document_id="report")
sources = [Source(id="report", parent_id=0, document_id="report", passage=passage,
segments=[Segment(text=passage, page=1)])]
result = engine.verify_answer(ANSWER, sources=sources, citations=records, fallback=False)
supports - cell 158 under 2024 The 2024 for North is 158.
insufficient table_value_unverified cell 133 under 2024 For South, column 2024, the table lists 120.
The engine selected the 158 printed under 2024, not the identical number under 2023. The second claim gives South's 2023 value as its 2024 value, so it is withheld. With fallback=False, only the records the model supplied are checked.
What comes back
| Field | Contents |
|---|---|
result.claims |
One entry per claim: verdict (for example supports or insufficient), reasons and supporting_records. |
result.citations |
Accepted citations only, with the boxes of the located quotation on the page. |
result.audit |
Every record, accepted or not: location_verified, support_verdict, reasons and accepted. For a table claim, support_details gives the observed cell value and its regions on the page. |
When a record cannot be verified
We tested each case below on the example report. The engine withholds the claim instead of guessing:
| Problem in the record | Result |
|---|---|
source_id is not one of your sources |
source_not_authorized |
| The quotation is not on the cited page, or the page is wrong | quote_location_unresolved |
Only part of the row is quoted, a multi-page source has no page, or the claim is free prose such as “North reported 158 in 2024.” |
No table cell is selected, and the claim is not approved. |
| The selected cell prints a different number | table_value_unverified |
One case is not an error to the engine. If the model names another row or heading that also exists on the page, the engine checks that cell. It verifies the claim as written, not what the model meant.
The blind panels supplied the claims from annotations. They measure cell attribution, not how reliably a model writes the claims.
One citation, two decisions
The model supplies the answer span, quotation and source ID. The host supplies the authorized passage, page and PDF. In this example the engine locates “The deposit is €350.” on page 1. The claim says €500. The audit records location_verified: true, support_verdict: "insufficient", reasons: ["value_or_condition_conflict"] and accepted: false. Read result.audit to see both decisions, including unsuccessful links. Here result.citations is empty.
Plain text and RAG answers
No PDF is needed when the source is text. examples/verify_text.py checks six citations against one synthetic annual-report passage:
supported - Revenue reached $10 million in 2024.
withheld value_or_condition_conflict Revenue reached $20 million in 2024.
withheld value_or_condition_conflict Operating costs increased in 2024.
withheld deterministic_support_missing Revenue will increase next year.
withheld deterministic_support_missing The company purchased a French business.
withheld quote_not_in_parent Revenue reached $10 million in 2024.
The last line uses the same claim as the first, but the submitted quotation says 2025 and is absent from the source. In the other withheld cases, the quote is present: the amount changes, “did not increase” becomes “increased”, “may” becomes “will”, or the wording falls outside the supported rules.
The RAG flow is the one shown in RAG answers that cite PDF tables; a text source needs no PDF. The excerpt below checks a text source.
In a RAG application, keep the retriever’s authorized passages separate from the model’s answer and citation records. The following excerpt uses the inputs defined in examples/rag_answer.py. Add generation_instructions() to your model prompt; the example supplies a saved response so you can run it offline.
from evidence_citations import CitationEngine, parse_records
records = parse_records(CITATIONS_JSON)
with CitationEngine(mode="text_only") as engine:
result = engine.verify_answer(ANSWER, sources=SOURCES, citations=records, fallback=False)
for claim in result.claims:
print(claim["claim_id"], claim["verdict"], ", ".join(claim["reasons"]) or "-")
claim-0-36 supports -
claim-37-71 insufficient value_or_condition_conflict
The two claim IDs identify character spans in the answer. Only the sources the host passes to the engine can authorize evidence. The post9 release includes both text examples; the pinned post8 links below reproduce the earlier table release.
Reproduce the comparison
python -B evaluation/tools/table1.py
Run this from the repository root. It reads the paired outcomes by cluster, recomputes Table 1 and its cluster-bootstrap intervals, and checks them against the archived scores. It runs offline with the Python standard library. The open Zenodo deposit contains the statistical inputs, scorer and timing results. Repeating the word-level audit requires the restricted manifests and per-job records; rerunning extraction also requires the upstream PDFs.
Existing tests and what each checks
- The source fixtures build PDFs with a wrong-column value, a quote on another page, truncated evidence and identical row text in two different tables.
- The comparator oracle checks cases such as
1 mgversus1 Mgand12versus1². The study wheel passed strict verdict checking on 867 must-support, 954 must-not-support and 14 either-verdict pairs. - The scorer self-test checks job completeness, control denominators and whether selected headings belong to the designated table.
To invoke the original checks, download the wheel from the release into the checkout after installing the library:
python -B tests/test_parent_fixtures.py evidence_citations-0.9.0.post8-py3-none-any.whl
python -B evaluation/tools/test_comparison_oracle.py --strict-verdicts --source evidence_citations-0.9.0.post8-py3-none-any.whl
python -B evaluation/tools/score_v090.py selftest
Citation and licensing
This repository accompanies Physical Cell Attribution for Numerical Claim Verification in PDF Tables. For the library, cite Evidence Citations 0.9.0.post8 (citation metadata). For the scoring tools and study results, cite Zenodo · 10.5281/zenodo.24731971.
The 52 Python implementation modules in the public wheel are byte-identical to those in the study engine 0.9.0. The packaging differs. The study used Python 3.12.10 and PyMuPDF 1.26.6. The SHA-256 digest of the study wheel is 7d02bbe6ac83f2b07458b2d5b3f994089c41c6317a1f9d6b3ce393125d5b64f7.
The engine is licensed under AGPL-3.0-only, the evaluation tools under Apache-2.0, and the author’s shareable study data under CDLA-Permissive-2.0. Upstream material retains its own terms. Component notice · Evaluation licences
Metadata
Release files for evidence-citations 0.9.0.post11
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 |
|---|---|---|---|---|
| evidence_citations-0.9.0.post11.tar.gz | 948.7 kB | With provenance | Details for evidence_citations-0.9.0.post11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| evidence_citations-0.9.0.post11-py3-none-any.whl | Python 3 | none | any | Details for evidence_citations-0.9.0.post11-py3-none-any.whl |
Total release size: 1.2 MB
Release files / evidence_citations-0.9.0.post11.tar.gz
| Download URL | evidence_citations-0.9.0.post11.tar.gz |
|---|---|
| Size | 948.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e8bf6b0fd7bd60d669e255d36189f4d1cfae43891894e402559c9e9e8240a5f
|
|
BLAKE2b-256 checksum How to use checksums |
a7fd19ec7c01b14e3cd3db029c1217b847efc6df6279d861fad17abd74f19534
|
| 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 Dec 2, 2026.
Transparency logRelease files / evidence_citations-0.9.0.post11-py3-none-any.whl
| Download URL | evidence_citations-0.9.0.post11-py3-none-any.whl |
|---|---|
| Size | 273.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81115c2c470a008fee1518a510eca8ba10238430abd1b35b06aa3d9f589ceb61
|
|
BLAKE2b-256 checksum How to use checksums |
7ae29c087d70c0ca5970056f54252d7e69d422d55588f49a2118ffc19e7b224c
|
| 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 Dec 2, 2026.
Transparency logSecurity for evidence-citations 0.9.0.post11
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 evidence_citations-0.9.0.post11.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 Dec 2, 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.