Ryenhails commited on
Commit
3847bc1
·
verified ·
1 Parent(s): 7458051

Verified evaluation set: 719 questions, metadata and normalised ground-truth geometry

Browse files
Files changed (3) hide show
  1. README.md +143 -0
  2. rehydrate.py +88 -0
  3. verified_eval_set.jsonl +0 -0
README.md ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ - zh
6
+ task_categories:
7
+ - visual-question-answering
8
+ - document-question-answering
9
+ tags:
10
+ - evidence-attribution
11
+ - visual-document-understanding
12
+ - attribution-hallucination
13
+ - document-grounding
14
+ size_categories:
15
+ - n<1K
16
+ configs:
17
+ - config_name: default
18
+ data_files: verified_eval_set.jsonl
19
+ ---
20
+
21
+ # Verified evaluation set for evidence attribution in visual documents
22
+
23
+ The 719-question evaluation set used in [**"Evidence Attribution in Visual Document
24
+ Understanding without Coordinates or Region Labels"**](https://arxiv.org/abs/2607.24651)
25
+ (Liu, Zhang, Xiao, 2026).
26
+
27
+ Code: [github.com/Ryenhails/quote-and-retrieve](https://github.com/Ryenhails/quote-and-retrieve) ·
28
+ Model: [Ryenhails/quote-and-retrieve-8b-grpo](https://huggingface.co/Ryenhails/quote-and-retrieve-8b-grpo)
29
+
30
+ ## What this is
31
+
32
+ CiteVQA links to source PDFs that are no longer all reachable, and some of the reachable ones
33
+ differ from the version that was annotated. Evaluating evidence attribution on those questions
34
+ measures broken links rather than models. This release is the subset whose annotations we could
35
+ verify against the PDF actually available, together with the normalised ground-truth geometry
36
+ needed to score against it.
37
+
38
+ Starting from the 987 single-document questions in the CiteVQA validation release, the filter
39
+ removes 117 questions whose source PDF does not resolve or is not a valid PDF, 4 whose annotated
40
+ evidence pages lie outside the downloaded file, 131 whose annotated evidence text does not match
41
+ the extracted page text, and 16 that cannot be byte-verified, retaining **719 questions over 440
42
+ documents (72.9%)**. The filter inspects only ground-truth annotations and document content, never
43
+ model outputs, so it cannot favour any system. Documents dropped for text mismatch have text
44
+ layers at least as rich as the retained ones, so the filter does not select for easy cases.
45
+
46
+ | | |
47
+ |---|---|
48
+ | questions | 719 (386 English, 333 Chinese) |
49
+ | documents | 440 PDFs, median 34 pages, longest 182 |
50
+ | necessary evidence elements | 1,034 |
51
+ | all annotated elements | 1,763 |
52
+ | question types | Complex Synthesis 394, Multimodal Parsing 136, Factual Retrieval 122, Quantitative Reasoning 67 |
53
+
54
+ ## What this contains, and what it does not
55
+
56
+ This release contains **identifiers, our verification metadata, and our normalised ground-truth
57
+ boxes**. It does **not** redistribute CiteVQA's question text, answers, or PDFs; download those
58
+ from the original release and join locally with the included script.
59
+
60
+ | field | meaning |
61
+ |---|---|
62
+ | `index` | question identifier, the join key to the CiteVQA release |
63
+ | `pdf_stem` | source PDF filename without extension |
64
+ | `language` | `en` or `zh` |
65
+ | `qtype` | question type, used for the per-type breakdowns in the paper |
66
+ | `n_pdf_pages` | document length in pages |
67
+ | `alignment` | our verification outcome: `verified` (366) when annotated evidence text was found in the extracted page text, `unverifiable` (353) when the page has no usable text layer to check against, for example a scanned page. Both are retained; questions whose text actively contradicted the annotation were removed. |
68
+ | `gt_pages` | 1-based pages holding necessary evidence |
69
+ | `gt_necessary` | necessary evidence elements as `[page, x1, y1, x2, y2]`; the recall denominator |
70
+ | `gt_all` | necessary plus optional supporting elements; the precision target set |
71
+
72
+ ### Coordinate normalisation
73
+
74
+ The released CiteVQA evidence boxes are ordered `[y1, x1, y2, x2]` on a 0-1000 scale, which does
75
+ not match the `x1y1x2y2` description in the benchmark's own prompt. We established the true order
76
+ by extracting page text inside candidate boxes and checking it against the annotated evidence
77
+ content. The boxes here are already converted to `x1 y1 x2 y2` in rendered-page pixel
78
+ coordinates, with 1-based page indices. Using the raw released order will silently produce near
79
+ zero recall.
80
+
81
+ ## Usage
82
+
83
+ ```bash
84
+ pip install huggingface_hub
85
+ huggingface-cli download Ryenhails/quote-and-retrieve-eval --repo-type dataset --local-dir eval_set
86
+ ```
87
+
88
+ Load the metadata directly:
89
+
90
+ ```python
91
+ from datasets import load_dataset
92
+
93
+ ds = load_dataset("Ryenhails/quote-and-retrieve-eval", split="train")
94
+ print(ds[0]["index"], ds[0]["gt_necessary"])
95
+ ```
96
+
97
+ To get records the pipeline can run on, join with your own CiteVQA download:
98
+
99
+ ```bash
100
+ python rehydrate.py \
101
+ --release verified_eval_set.jsonl \
102
+ --citevqa /path/to/CiteVQA/data/validation/CiteVQA.json \
103
+ --pdf-dir /path/to/CiteVQA/data/pdf \
104
+ --out citevqa_singledoc_pub.jsonl
105
+ ```
106
+
107
+ The output is byte-identical in schema to what `src/build_citevqa_pub.py` produces in the code
108
+ repository, so every downstream script runs unchanged. See
109
+ [docs/using_the_release.md](https://github.com/Ryenhails/quote-and-retrieve/blob/main/docs/using_the_release.md)
110
+ for the end-to-end path from this file to the paper's tables.
111
+
112
+ ## Scoring
113
+
114
+ A citation matches an annotated element when both lie on the same page and their IoU is at least
115
+ 0.5. Recall is computed per question over `gt_necessary` and macro-averaged over questions;
116
+ precision is scored against `gt_all`, so citing optional supporting evidence is not an error. The
117
+ exact semantics, including the two protocol choices that are ours rather than the benchmark's, are
118
+ in
119
+ [docs/scoring_protocol.md](https://github.com/Ryenhails/quote-and-retrieve/blob/main/docs/scoring_protocol.md)
120
+ and are asserted by the repository's test suite.
121
+
122
+ ## Licensing
123
+
124
+ The metadata and derived geometry in this release are MIT licensed. The underlying questions,
125
+ answers, annotations, and documents belong to CiteVQA and remain under its terms; obtain them
126
+ from the original release.
127
+
128
+ ## Citation
129
+
130
+ ```bibtex
131
+ @article{liu2026evidence,
132
+ title = {Evidence Attribution in Visual Document Understanding without Coordinates or Region Labels},
133
+ author = {Liu, Zhuchenyang and Zhang, Yao and Xiao, Yu},
134
+ journal = {arXiv preprint arXiv:2607.24651},
135
+ year = {2026},
136
+ eprint = {2607.24651},
137
+ archivePrefix = {arXiv},
138
+ primaryClass = {cs.CV},
139
+ url = {https://arxiv.org/abs/2607.24651}
140
+ }
141
+ ```
142
+
143
+ Please also cite CiteVQA, whose annotations this release builds on.
rehydrate.py ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Join this release with your own CiteVQA download to get runnable records.
3
+
4
+ This dataset ships identifiers, our verification metadata, and our normalised
5
+ ground-truth boxes. It deliberately does not redistribute the benchmark's
6
+ question text, answers, or PDFs. Download those from the original CiteVQA
7
+ release, then run this script to produce the record format the pipeline reads.
8
+
9
+ python rehydrate.py \
10
+ --release verified_eval_set.jsonl \
11
+ --citevqa /path/to/CiteVQA/data/validation/CiteVQA.json \
12
+ --pdf-dir /path/to/CiteVQA/data/pdf \
13
+ --out citevqa_singledoc_pub.jsonl
14
+
15
+ The output is exactly what `src/build_citevqa_pub.py` in the code repository
16
+ produces, so every downstream script runs unchanged:
17
+
18
+ https://github.com/Ryenhails/quote-and-retrieve
19
+ """
20
+ import argparse
21
+ import json
22
+ import os
23
+ import sys
24
+
25
+
26
+ def main():
27
+ ap = argparse.ArgumentParser()
28
+ ap.add_argument("--release", default="verified_eval_set.jsonl")
29
+ ap.add_argument("--citevqa", required=True,
30
+ help="path to the CiteVQA validation JSON from the original release")
31
+ ap.add_argument("--pdf-dir", required=True,
32
+ help="directory holding the source PDFs")
33
+ ap.add_argument("--out", default="citevqa_singledoc_pub.jsonl")
34
+ args = ap.parse_args()
35
+
36
+ release = [json.loads(line) for line in open(args.release)]
37
+ print(f"release records: {len(release)}")
38
+
39
+ raw = json.load(open(args.citevqa))
40
+ if isinstance(raw, dict):
41
+ raw = raw.get("data") or next(v for v in raw.values() if isinstance(v, list))
42
+ by_index = {}
43
+ for item in raw:
44
+ idx = item.get("index") or item.get("id") or item.get("question_id")
45
+ if idx is not None:
46
+ by_index[str(idx)] = item
47
+ print(f"benchmark records loaded: {len(by_index)}")
48
+
49
+ out, missing_q, missing_pdf = [], 0, 0
50
+ for r in release:
51
+ src = by_index.get(r["index"])
52
+ if src is None:
53
+ missing_q += 1
54
+ continue
55
+ pdf = os.path.join(args.pdf_dir, r["pdf_stem"] + ".pdf")
56
+ if not os.path.exists(pdf):
57
+ missing_pdf += 1
58
+ continue
59
+ out.append({
60
+ "index": r["index"],
61
+ "question": src.get("question") or src.get("Question"),
62
+ "standard_answer": src.get("answer") or src.get("standard_answer"),
63
+ "language": r["language"],
64
+ "qtype": r["qtype"],
65
+ "n_pdf_pages": r["n_pdf_pages"],
66
+ "alignment": r["alignment"],
67
+ "pdf_path": pdf,
68
+ "gt_pages": r["gt_pages"],
69
+ "gt_necessary": r["gt_necessary"],
70
+ "gt_all": r["gt_all"],
71
+ })
72
+
73
+ with open(args.out, "w") as f:
74
+ for d in out:
75
+ f.write(json.dumps(d, ensure_ascii=False) + "\n")
76
+
77
+ print(f"wrote {len(out)} records -> {args.out}")
78
+ if missing_q:
79
+ print(f" {missing_q} identifiers not found in the benchmark file")
80
+ if missing_pdf:
81
+ print(f" {missing_pdf} source PDFs not found in {args.pdf_dir}")
82
+ if len(out) != len(release):
83
+ print(" note: the paper's numbers assume all 719 records are present")
84
+ sys.exit(1)
85
+
86
+
87
+ if __name__ == "__main__":
88
+ main()
verified_eval_set.jsonl ADDED
The diff for this file is too large to render. See raw diff