daiqi commited on
Commit
72954bd
·
verified ·
1 Parent(s): 8dc5413

Upload folder using huggingface_hub

Browse files
.DS_Store ADDED
Binary file (6.15 kB). View file
 
README.md CHANGED
@@ -1,3 +1,214 @@
1
  ---
2
- license: mit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
+ license: other
5
+ pretty_name: XL-DocBench
6
+ task_categories:
7
+ - question-answering
8
+ tags:
9
+ - document-understanding
10
+ - long-context
11
+ - multimodal-document-ai
12
+ - cross-document-qa
13
+ - benchmark
14
+ size_categories:
15
+ - 1K<n<10K
16
+ configs:
17
+ - config_name: single_doc
18
+ default: true
19
+ data_files:
20
+ - split: test
21
+ path: data/qa_single_doc.jsonl
22
+ - config_name: cross_doc
23
+ data_files:
24
+ - split: test
25
+ path: data/qa_cross_doc.jsonl
26
+ - config_name: documents
27
+ data_files:
28
+ - split: documents
29
+ path: data/documents.jsonl
30
+ - config_name: scores
31
+ data_files:
32
+ - split: results
33
+ path: results/scores.jsonl
34
  ---
35
+
36
+ <div align="center">
37
+
38
+ <h1>XL-DocBench</h1>
39
+
40
+ <p>
41
+ Evidence-grounded reasoning across hundreds or thousands of pages.<br>
42
+ Fully verified by 194 human experts.
43
+ </p>
44
+
45
+ <p>
46
+ Hongchen Wei<sup>1,†,‡</sup>, Yuanzhe Wang<sup>2,†,‡</sup>,
47
+ Bei Liu<sup>2,*</sup>, Yifan Yang<sup>2</sup>, Qi Dai<sup>2</sup>,
48
+ Ruichun Ma<sup>2</sup>, Kai Qiu<sup>2</sup>, Yunsheng Li<sup>2</sup>,<br>
49
+ Dongdong Chen<sup>2</sup>, Chong Luo<sup>2</sup>,
50
+ Zhenzhong Chen<sup>1</sup>, Baining Guo<sup>2</sup>
51
+ </p>
52
+
53
+ <p>
54
+ <sup>1</sup>Wuhan University &nbsp; <sup>2</sup>Microsoft &nbsp;
55
+ <sup>†</sup>Equal contribution &nbsp; <sup>‡</sup>Work done during an internship at MSRA &nbsp;
56
+ <sup>*</sup>Project leader
57
+ </p>
58
+
59
+ <p>
60
+ <a href="https://officeintelligence.github.io/xl-docbench/"><b>Project Page</b></a> ·
61
+ <a href="https://arxiv.org/abs/2608.00036"><b>Paper</b></a> ·
62
+ <a href="https://officeintelligence.github.io/xl-docbench/#leaderboard"><b>Live Leaderboard</b></a>
63
+ </p>
64
+
65
+ <p>
66
+ <a href="https://arxiv.org/abs/2608.00036"><img src="https://img.shields.io/badge/arXiv-2608.00036-b31b1b.svg" alt="arXiv"></a>
67
+ <img src="https://img.shields.io/badge/questions-1,345-3b5b92.svg" alt="1,345 questions">
68
+ <img src="https://img.shields.io/badge/documents-292-6a4c93.svg" alt="292 documents">
69
+ <img src="https://img.shields.io/badge/human_verified-194_experts-2d6a4f.svg" alt="Verified by 194 experts">
70
+ </p>
71
+
72
+ </div>
73
+
74
+ ## TL;DR
75
+
76
+ This is the **conservative XL-DocBench release**. It contains
77
+ **1,345 QA rows over 292 documents** after
78
+ removing every question that touches an exact source URL marked
79
+ `RAG: Not Approved`.
80
+
81
+ ## This release
82
+
83
+ **292 documents** · **1,191 single-document QA** ·
84
+ **154 cross-document QA** · **1,345 total QA**
85
+
86
+ - `data/documents.jsonl`: retained document metadata and source URLs.
87
+ - `data/qa_single_doc.jsonl`: retained single-document questions.
88
+ - `data/qa_cross_doc.jsonl`: retained cross-document questions.
89
+ - `manifest.json`: recomputed release statistics.
90
+ - `results/scores.jsonl`: per-question scores for the 13 reproducible systems.
91
+ - `results/summary.json`: aggregate scores for the same systems.
92
+ - `code/quickstart.py`: one-command data and evaluator smoke test.
93
+ - `code/evaluate.py`: self-contained deterministic evaluator.
94
+
95
+ The filter uses exact URL matching. This variant addresses exact `Not Approved`
96
+ RAG rows only and does not interpret separate `Portions Approved` entries.
97
+
98
+ ## About XL-DocBench
99
+
100
+ XL-DocBench asks systems to **find the evidence, combine all required support,
101
+ apply the right rule, and know when to abstain**. This strict release contains
102
+ 1,345 expert-verified questions from six professional domains. Among 1,280
103
+ records with parseable historical human page annotations, 975 (76.2%) use
104
+ multiple evidence pages. Released supporting evidence is multimodal for 429
105
+ questions (31.9%), 154 questions (11.4%) use cross-document contexts, and 188
106
+ require a `None` answer. Full-series contexts reach 2,935 pages.
107
+
108
+ ## Reproducible strict results
109
+
110
+ All systems below have complete scores for the 1,345 retained IDs and use the
111
+ hardened evaluator shipped in this release.
112
+
113
+ | Rank | System | Input | Accuracy ↑ | Token F1 ↑ | ANLS ↑ |
114
+ |---:|---|:---:|---:|---:|---:|
115
+ | 1 | **GPT-5.4** | OCR | **38.36** | **39.70** | **34.17** |
116
+ | 2 | SimpleDoc + GPT-5.4 | Agent | 36.21 | 33.62 | 24.30 |
117
+ | 3 | Kimi-K2.5 | OCR | 36.06 | 38.24 | 32.64 |
118
+ | 4 | MDocAgent + GPT-5.4 | Agent | 31.82 | 30.58 | 22.64 |
119
+ | 5 | GPT-5.2 | OCR | 31.15 | 33.69 | 28.51 |
120
+ | 6 | DeepSeek-V3.2 | OCR | 29.67 | 32.99 | 28.91 |
121
+ | 7 | Qwen3.5-4B | OCR | 29.00 | 32.23 | 28.13 |
122
+ | 8 | DeepRead + GPT-5.4 | Agent | 27.73 | 26.99 | 21.17 |
123
+ | 9 | GPT-5.4 | Img | 26.77 | 29.76 | 26.33 |
124
+ | 10 | Kimi-K2.5 | Img | 26.02 | 27.59 | 23.04 |
125
+ | 11 | GPT-5.2 | Img | 21.71 | 24.95 | 21.92 |
126
+ | 12 | Qwen3.5-4B | Img | 20.52 | 20.86 | 18.26 |
127
+ | 13 | Qwen3.5-9B | Img | 20.22 | 22.69 | 20.18 |
128
+
129
+ ## Per-question scores
130
+
131
+ Source documents are referenced by public URLs rather than redistributed.
132
+ Because some URLs may change or become unavailable over time, we also provide
133
+ the benchmark scores for every retained question ID. This gives future users a
134
+ stable comparison point even when a source URL is temporarily unavailable.
135
+
136
+ - `results/scores.jsonl`: one row for each of the 1,345 question IDs.
137
+ - `results/summary.json`: aggregate Accuracy, Token F1, and ANLS.
138
+
139
+ Scores are stored on a 0-to-1 scale.
140
+
141
+ ## Quick start
142
+
143
+ Validate the complete release and run a five-question evaluation fixture:
144
+
145
+ ```bash
146
+ uv run --no-project python code/quickstart.py
147
+ ```
148
+
149
+ Load all three JSONL tables with the included standard-library example:
150
+
151
+ ```bash
152
+ uv run --no-project python code/examples/load_data.py
153
+ ```
154
+
155
+ ## Evaluation
156
+
157
+ Try the bundled five-question example:
158
+
159
+ ```bash
160
+ uv run --no-project python code/evaluate.py \
161
+ --gold-files code/examples/gold_sample.jsonl \
162
+ --predictions code/examples/predictions_sample.jsonl
163
+ ```
164
+
165
+ For a complete run, provide one prediction per question:
166
+
167
+ ```jsonl
168
+ {"question_id": "adubench_single_000001", "prediction": "the biggest single risk to human health worldwide"}
169
+ {"question_id": "adubench_cross_000001", "prediction": "macroprudential measures"}
170
+ ```
171
+
172
+ ```bash
173
+ uv run --no-project python code/evaluate.py \
174
+ --predictions predictions.jsonl \
175
+ --output eval_report.json \
176
+ --per-question-csv per_question.csv
177
+ ```
178
+
179
+ The evaluator reports rule-based **Accuracy**, token-level **F1**, and **ANLS**.
180
+ Missing, failed, and unparsable predictions count as incorrect unless
181
+ `--ignore-missing` is enabled.
182
+
183
+ ## Record structure
184
+
185
+ ```text
186
+ question
187
+ ├── answer: value + format + verification rule
188
+ ├── document / documents
189
+ │ ├── document_id + public URL
190
+ │ ├── evidence_pages: one-based PDF/release page indices
191
+ │ └── evidence_items: annotator locator + page references + excerpt kind
192
+ └── metadata: domain + difficulty + reasoning type + answerability
193
+ ```
194
+
195
+ `evidence_pages` locate pages in the released PDF context. Evidence-item
196
+ `pages` preserve annotator-supplied page references; printed pagination can
197
+ differ from PDF indices. The `page_numbering` and `evidence_kind` fields make
198
+ those cases explicit. Row-level `unassigned_evidence_items` are retained as
199
+ provenance and are not counted as released supporting evidence.
200
+
201
+ PDF binaries and local filenames are not included. Source documents remain
202
+ subject to their original licenses and terms; this release does not grant
203
+ redistribution rights for third-party PDFs.
204
+
205
+ ## Citation
206
+
207
+ ```bibtex
208
+ @article{wei2026xldocbench,
209
+ title = {XL-DocBench: Benchmarking Evidence-Grounded Extra-Long Document Understanding},
210
+ author = {Wei, Hongchen and Wang, Yuanzhe and Liu, Bei and Yang, Yifan and Dai, Qi and Ma, Ruichun and Qiu, Kai and Li, Yunsheng and Chen, Dongdong and Luo, Chong and Chen, Zhenzhong and Guo, Baining},
211
+ journal = {arXiv preprint arXiv:2608.00036},
212
+ year = {2026}
213
+ }
214
+ ```
code/.DS_Store ADDED
Binary file (6.15 kB). View file
 
code/README.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # XL-DocBench Code
2
+
3
+ All runnable code is kept in this directory. The release smoke test and
4
+ evaluator require only Python's standard library.
5
+
6
+ ## One-command smoke test
7
+
8
+ Run from the release root:
9
+
10
+ ```bash
11
+ uv run --no-project python code/quickstart.py
12
+ ```
13
+
14
+ This validates the data files, IDs, document references, evidence metadata,
15
+ per-question score coverage, manifest counts, and a five-question evaluation
16
+ fixture.
17
+
18
+ ## Files
19
+
20
+ - `quickstart.py`: zero-dependency release validation and evaluation smoke test.
21
+ - `evaluate.py`: primary Accuracy, Token F1, and ANLS evaluator.
22
+ - `examples/load_data.py`: minimal standard-library data loader.
23
+ - `examples/gold_sample.jsonl`: five-record evaluation fixture.
24
+ - `examples/predictions_sample.jsonl`: perfect predictions for that fixture.
25
+
26
+ ## Examples
27
+
28
+ ```bash
29
+ uv run --no-project python code/examples/load_data.py
30
+
31
+ uv run --no-project python code/evaluate.py \
32
+ --gold-files code/examples/gold_sample.jsonl \
33
+ --predictions code/examples/predictions_sample.jsonl
34
+ ```
code/evaluate.py ADDED
@@ -0,0 +1,638 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Evaluate XL-DocBench predictions.
3
+
4
+ This script is intentionally self-contained for public release. It computes the
5
+ deterministic metrics used in the benchmark tables: relaxed Accuracy,
6
+ token-level F1, and ANLS. It does not call any model or require private files.
7
+
8
+ Prediction JSONL format:
9
+ {"question_id": "adubench_single_000001", "prediction": "..."}
10
+
11
+ The prediction field may also be named ``model_answer``, ``answer``,
12
+ ``response``, or ``output``. JSON files are also accepted, including mappings
13
+ from question_id to answer or internal-style ``{"items": {...}}`` files.
14
+ """
15
+
16
+ from __future__ import annotations
17
+
18
+ import argparse
19
+ import csv
20
+ import json
21
+ import re
22
+ import sys
23
+ from collections import defaultdict
24
+ from dataclasses import dataclass, field
25
+ from pathlib import Path
26
+ from typing import Any
27
+
28
+ ANSWER_FORMAT_MAP = {
29
+ "Str": "entity",
30
+ "Int": "numeric",
31
+ "Float": "numeric",
32
+ "None": "unanswerable",
33
+ "Bool": "boolean",
34
+ "Boolean": "boolean",
35
+ "Percentage": "percentage",
36
+ }
37
+
38
+ PREDICTION_FIELDS = ("prediction", "model_answer", "answer", "response", "output")
39
+ QUESTION_ID_FIELDS = ("question_id", "global_qa_id", "global_id", "id")
40
+ SUCCESS_STATUSES = {"success", "ok", "completed"}
41
+
42
+
43
+ @dataclass
44
+ class MetricBucket:
45
+ accuracy: list[float] = field(default_factory=list)
46
+ token_f1: list[float] = field(default_factory=list)
47
+ anls: list[float] = field(default_factory=list)
48
+
49
+ def add(self, accuracy: float, token_f1: float, anls: float) -> None:
50
+ self.accuracy.append(accuracy)
51
+ self.token_f1.append(token_f1)
52
+ self.anls.append(anls)
53
+
54
+ def summary(self) -> dict[str, float | int]:
55
+ return {
56
+ "count": len(self.accuracy),
57
+ "accuracy": average(self.accuracy),
58
+ "token_f1": average(self.token_f1),
59
+ "anls": average(self.anls),
60
+ }
61
+
62
+
63
+ def average(values: list[float]) -> float:
64
+ return round(sum(values) / len(values), 6) if values else 0.0
65
+
66
+
67
+ def load_jsonl(path: Path) -> list[dict[str, Any]]:
68
+ rows: list[dict[str, Any]] = []
69
+ with path.open("r", encoding="utf-8") as handle:
70
+ for line_number, line in enumerate(handle, start=1):
71
+ line = line.strip()
72
+ if not line:
73
+ continue
74
+ try:
75
+ value = json.loads(line)
76
+ except json.JSONDecodeError as exc:
77
+ raise ValueError(f"Invalid JSON on {path}:{line_number}") from exc
78
+ if not isinstance(value, dict):
79
+ raise TypeError(f"Expected object on {path}:{line_number}")
80
+ rows.append(value)
81
+ return rows
82
+
83
+
84
+ def load_json_or_jsonl(path: Path) -> Any:
85
+ if path.suffix.lower() == ".jsonl":
86
+ return load_jsonl(path)
87
+ with path.open("r", encoding="utf-8") as handle:
88
+ return json.load(handle)
89
+
90
+
91
+ def get_question_id(row: dict[str, Any]) -> str:
92
+ for field_name in QUESTION_ID_FIELDS:
93
+ value = row.get(field_name)
94
+ if value is not None and str(value).strip():
95
+ return str(value).strip()
96
+ return ""
97
+
98
+
99
+ def string_value(value: Any) -> str:
100
+ if value is None:
101
+ return ""
102
+ if isinstance(value, (str, int, float, bool)):
103
+ return str(value)
104
+ return json.dumps(value, ensure_ascii=False, sort_keys=True)
105
+
106
+
107
+ def answer_payload(row: dict[str, Any]) -> dict[str, Any]:
108
+ value = row.get("answer", {})
109
+ return value if isinstance(value, dict) else {"value": value}
110
+
111
+
112
+ def gold_answer(row: dict[str, Any]) -> str:
113
+ return string_value(answer_payload(row).get("value", ""))
114
+
115
+
116
+ def answer_format(row: dict[str, Any]) -> str:
117
+ payload = answer_payload(row)
118
+ raw_format = string_value(payload.get("format", "Str")) or "Str"
119
+ verification_rule = string_value(payload.get("verification_rule", ""))
120
+ if verification_rule == "choice_exact_match":
121
+ return "single_choice"
122
+ if verification_rule == "percentage_exact":
123
+ return "percentage"
124
+ if raw_format in ANSWER_FORMAT_MAP:
125
+ return ANSWER_FORMAT_MAP[raw_format]
126
+ if "numeric" in verification_rule or "tolerance" in verification_rule:
127
+ return "numeric"
128
+ return raw_format.lower()
129
+
130
+
131
+ def metadata(row: dict[str, Any]) -> dict[str, Any]:
132
+ value = row.get("metadata", {})
133
+ return value if isinstance(value, dict) else {}
134
+
135
+
136
+ def load_gold_records(gold_files: list[Path]) -> dict[str, dict[str, Any]]:
137
+ if not gold_files:
138
+ raise ValueError("At least one gold file is required")
139
+
140
+ records: dict[str, dict[str, Any]] = {}
141
+ for path in gold_files:
142
+ for row in load_jsonl(path):
143
+ question_id = get_question_id(row)
144
+ if not question_id:
145
+ raise ValueError(f"Missing question_id in {path}")
146
+ if question_id in records:
147
+ raise ValueError(f"Duplicate question_id in gold data: {question_id}")
148
+ records[question_id] = row
149
+ if not records:
150
+ raise ValueError("No gold records found")
151
+ return records
152
+
153
+
154
+ def extract_prediction(row: Any, prediction_field: str = "") -> str:
155
+ if not isinstance(row, dict):
156
+ return string_value(row)
157
+
158
+ if prediction_field:
159
+ if prediction_field not in row:
160
+ raise ValueError(f"Prediction field not found: {prediction_field}")
161
+ value = row[prediction_field]
162
+ if isinstance(value, dict) and "value" in value:
163
+ return string_value(value["value"])
164
+ return string_value(value)
165
+
166
+ for field_name in PREDICTION_FIELDS:
167
+ if field_name not in row:
168
+ continue
169
+ value = row[field_name]
170
+ if field_name == "answer" and isinstance(value, dict):
171
+ return string_value(value.get("value", ""))
172
+ return string_value(value)
173
+ return ""
174
+
175
+
176
+ def load_predictions(
177
+ path: Path, prediction_field: str = ""
178
+ ) -> tuple[dict[str, str], dict[str, str]]:
179
+ payload = load_json_or_jsonl(path)
180
+ predictions: dict[str, str] = {}
181
+ statuses: dict[str, str] = {}
182
+
183
+ def add(question_id: str, value: Any) -> None:
184
+ if not question_id:
185
+ raise ValueError(f"Prediction row is missing a question id: {value!r}")
186
+ if question_id in predictions:
187
+ raise ValueError(f"Duplicate question_id in predictions: {question_id}")
188
+ predictions[question_id] = extract_prediction(value, prediction_field)
189
+ if isinstance(value, dict):
190
+ statuses[question_id] = (
191
+ string_value(value.get("status", "success")) or "success"
192
+ )
193
+ else:
194
+ statuses[question_id] = "success"
195
+
196
+ if isinstance(payload, list):
197
+ for row in payload:
198
+ if not isinstance(row, dict):
199
+ raise TypeError("Prediction JSONL/list rows must be objects")
200
+ add(get_question_id(row), row)
201
+ elif isinstance(payload, dict) and isinstance(payload.get("items"), dict):
202
+ for question_id, row in payload["items"].items():
203
+ add(str(question_id), row)
204
+ elif isinstance(payload, dict) and get_question_id(payload):
205
+ add(get_question_id(payload), payload)
206
+ elif isinstance(payload, dict):
207
+ for question_id, row in payload.items():
208
+ add(str(question_id), row)
209
+ else:
210
+ raise TypeError("Unsupported prediction file format")
211
+
212
+ return predictions, statuses
213
+
214
+
215
+ def normalize_answer(text: str) -> str:
216
+ text = text.strip().lower()
217
+ for prefix in ("the answer is", "answer:", "answer is"):
218
+ if text.startswith(prefix):
219
+ text = text[len(prefix) :].strip()
220
+ text = re.sub(r"[^\w\s\.\-\%]", "", text)
221
+ text = re.sub(r"\b(a|an|the)\b", " ", text)
222
+ return re.sub(r"\s+", " ", text).strip()
223
+
224
+
225
+ def extract_number(text: str) -> float | None:
226
+ compact = text.replace(" ", "")
227
+
228
+ power_match = re.search(
229
+ r"(?P<base>[-+]?(?:\d+(?:\.\d+)?|\.\d+))\^(?P<exponent>[-+]?\d+)",
230
+ compact,
231
+ )
232
+ if power_match:
233
+ try:
234
+ return float(power_match.group("base")) ** int(
235
+ power_match.group("exponent")
236
+ )
237
+ except (OverflowError, ValueError):
238
+ return None
239
+
240
+ fraction_match = re.search(
241
+ r"(?P<numerator>[-+]?(?:\d+(?:\.\d+)?|\.\d+))/(?P<denominator>[-+]?(?:\d+(?:\.\d+)?|\.\d+))",
242
+ compact,
243
+ )
244
+ if fraction_match:
245
+ try:
246
+ denominator = float(fraction_match.group("denominator"))
247
+ if denominator == 0:
248
+ return None
249
+ return float(fraction_match.group("numerator")) / denominator
250
+ except ValueError:
251
+ return None
252
+
253
+ match = re.search(
254
+ r"[-+]?(?:\d{1,3}(?:,\d{3})+(?:\.\d+)?|\d+(?:[.,]\d+)?|\.\d+)(?:[eE][-+]?\d+)?",
255
+ compact,
256
+ )
257
+ if not match:
258
+ return None
259
+ token = match.group()
260
+ if "," in token and "." not in token:
261
+ integer, fractional = token.split(",", maxsplit=1)
262
+ token = (
263
+ f"{integer}.{fractional}"
264
+ if len(fractional) <= 2
265
+ else token.replace(",", "")
266
+ )
267
+ else:
268
+ token = token.replace(",", "")
269
+ try:
270
+ return float(token)
271
+ except ValueError:
272
+ return None
273
+
274
+
275
+ def parse_boolean(text: str) -> bool | None:
276
+ tokens = set(normalize_answer(text).split())
277
+ positive = bool(tokens & {"yes", "true", "correct"})
278
+ negative = bool(tokens & {"no", "false", "incorrect"})
279
+ if positive == negative:
280
+ return None
281
+ return positive
282
+
283
+
284
+ def levenshtein_distance(left: str, right: str) -> int:
285
+ if len(left) < len(right):
286
+ return levenshtein_distance(right, left)
287
+ if not right:
288
+ return len(left)
289
+
290
+ previous_row = list(range(len(right) + 1))
291
+ for left_index, left_char in enumerate(left):
292
+ current_row = [left_index + 1]
293
+ for right_index, right_char in enumerate(right):
294
+ substitution_cost = 0 if left_char == right_char else 1
295
+ current_row.append(
296
+ min(
297
+ current_row[right_index] + 1,
298
+ previous_row[right_index + 1] + 1,
299
+ previous_row[right_index] + substitution_cost,
300
+ )
301
+ )
302
+ previous_row = current_row
303
+ return previous_row[-1]
304
+
305
+
306
+ def normalized_levenshtein_similarity(prediction: str, gold: str) -> float:
307
+ prediction = prediction.strip().lower()
308
+ gold = gold.strip().lower()
309
+ if not prediction and not gold:
310
+ return 1.0
311
+ if not prediction or not gold:
312
+ return 0.0
313
+ distance = levenshtein_distance(prediction, gold)
314
+ return 1.0 - distance / max(len(prediction), len(gold))
315
+
316
+
317
+ def anls_score(prediction: str, gold: str, threshold: float = 0.5) -> float:
318
+ similarity = normalized_levenshtein_similarity(prediction, gold)
319
+ return similarity if similarity >= threshold else 0.0
320
+
321
+
322
+ def accuracy_score(prediction: str, gold: str, answer_type: str) -> float:
323
+ prediction_norm = normalize_answer(prediction)
324
+ gold_norm = normalize_answer(gold)
325
+
326
+ if answer_type == "unanswerable":
327
+ phrases = (
328
+ "not answerable",
329
+ "unanswerable",
330
+ "cannot be determined",
331
+ "cannot be answered",
332
+ "not enough information",
333
+ )
334
+ return 1.0 if any(phrase in prediction_norm for phrase in phrases) else 0.0
335
+
336
+ if answer_type == "boolean":
337
+ prediction_bool = parse_boolean(prediction)
338
+ gold_bool = parse_boolean(gold)
339
+ return (
340
+ 1.0 if prediction_bool is not None and prediction_bool == gold_bool else 0.0
341
+ )
342
+
343
+ if answer_type in {"numeric", "percentage"}:
344
+ prediction_number = extract_number(prediction)
345
+ gold_number = extract_number(gold)
346
+ if prediction_number is None or gold_number is None:
347
+ return 0.0
348
+ if gold_number == 0:
349
+ return 1.0 if abs(prediction_number) < 1e-6 else 0.0
350
+ relative_error = abs(prediction_number - gold_number) / abs(gold_number)
351
+ return 1.0 if relative_error <= 0.05 else 0.0
352
+
353
+ if answer_type == "single_choice":
354
+ prediction_option = re.search(r"\b([A-D])\b", prediction.strip().upper())
355
+ gold_option = re.search(r"\b([A-D])\b", gold.strip().upper())
356
+ return (
357
+ 1.0
358
+ if prediction_option
359
+ and gold_option
360
+ and prediction_option.group(1) == gold_option.group(1)
361
+ else 0.0
362
+ )
363
+
364
+ if gold_norm and gold_norm in prediction_norm:
365
+ return 1.0
366
+ if normalized_levenshtein_similarity(prediction_norm, gold_norm) >= 0.8:
367
+ return 1.0
368
+ return 0.0
369
+
370
+
371
+ def token_f1_score(prediction: str, gold: str) -> float:
372
+ prediction_tokens = set(normalize_answer(prediction).split())
373
+ gold_tokens = set(normalize_answer(gold).split())
374
+ if not gold_tokens:
375
+ return 1.0 if not prediction_tokens else 0.0
376
+ if not prediction_tokens:
377
+ return 0.0
378
+ overlap = prediction_tokens & gold_tokens
379
+ if not overlap:
380
+ return 0.0
381
+ precision = len(overlap) / len(prediction_tokens)
382
+ recall = len(overlap) / len(gold_tokens)
383
+ return 2 * precision * recall / (precision + recall)
384
+
385
+
386
+ def add_breakdown(
387
+ breakdowns: dict[str, dict[str, MetricBucket]],
388
+ name: str,
389
+ key: Any,
390
+ accuracy: float,
391
+ token_f1: float,
392
+ anls: float,
393
+ ) -> None:
394
+ label = string_value(key) or "unknown"
395
+ breakdowns[name][label].add(accuracy, token_f1, anls)
396
+
397
+
398
+ def evaluate(
399
+ gold_records: dict[str, dict[str, Any]],
400
+ predictions: dict[str, str],
401
+ statuses: dict[str, str],
402
+ ignore_missing: bool = False,
403
+ ) -> dict[str, Any]:
404
+ overall = MetricBucket()
405
+ breakdowns: dict[str, dict[str, MetricBucket]] = {
406
+ "split": defaultdict(MetricBucket),
407
+ "domain": defaultdict(MetricBucket),
408
+ "reasoning_type": defaultdict(MetricBucket),
409
+ "answer_format": defaultdict(MetricBucket),
410
+ "difficulty": defaultdict(MetricBucket),
411
+ "doc_type": defaultdict(MetricBucket),
412
+ "evidence_source": defaultdict(MetricBucket),
413
+ }
414
+ per_question: list[dict[str, Any]] = []
415
+ missing_count = 0
416
+
417
+ for question_id, row in gold_records.items():
418
+ if question_id not in predictions:
419
+ missing_count += 1
420
+ if ignore_missing:
421
+ continue
422
+ prediction = predictions.get(question_id, "")
423
+ status = statuses.get(question_id, "missing")
424
+
425
+ gold = gold_answer(row)
426
+ answer_type = answer_format(row)
427
+ normalized_status = (
428
+ status.strip().casefold().replace("-", "_").replace(" ", "_")
429
+ )
430
+ if normalized_status in SUCCESS_STATUSES:
431
+ accuracy = accuracy_score(prediction, gold, answer_type)
432
+ token_f1 = token_f1_score(prediction, gold)
433
+ anls = anls_score(prediction, gold)
434
+ else:
435
+ accuracy = 0.0
436
+ token_f1 = 0.0
437
+ anls = 0.0
438
+ overall.add(accuracy, token_f1, anls)
439
+
440
+ row_metadata = metadata(row)
441
+ split = string_value(row.get("task_type", "unknown"))
442
+ add_breakdown(breakdowns, "split", split, accuracy, token_f1, anls)
443
+ add_breakdown(
444
+ breakdowns, "domain", row_metadata.get("domain"), accuracy, token_f1, anls
445
+ )
446
+ add_breakdown(
447
+ breakdowns,
448
+ "reasoning_type",
449
+ row_metadata.get("reasoning_type"),
450
+ accuracy,
451
+ token_f1,
452
+ anls,
453
+ )
454
+ add_breakdown(
455
+ breakdowns,
456
+ "answer_format",
457
+ answer_payload(row).get("format"),
458
+ accuracy,
459
+ token_f1,
460
+ anls,
461
+ )
462
+ add_breakdown(
463
+ breakdowns,
464
+ "difficulty",
465
+ row_metadata.get("difficulty"),
466
+ accuracy,
467
+ token_f1,
468
+ anls,
469
+ )
470
+ add_breakdown(
471
+ breakdowns,
472
+ "doc_type",
473
+ row_metadata.get("doc_type"),
474
+ accuracy,
475
+ token_f1,
476
+ anls,
477
+ )
478
+
479
+ evidence_sources = row_metadata.get("evidence_sources") or ["unknown"]
480
+ if not isinstance(evidence_sources, list):
481
+ evidence_sources = [evidence_sources]
482
+ for evidence_source in evidence_sources:
483
+ add_breakdown(
484
+ breakdowns, "evidence_source", evidence_source, accuracy, token_f1, anls
485
+ )
486
+
487
+ per_question.append(
488
+ {
489
+ "question_id": question_id,
490
+ "prediction": prediction,
491
+ "gold_answer": gold,
492
+ "answer_format": answer_payload(row).get("format", "Str"),
493
+ "status": status,
494
+ "accuracy": round(accuracy, 6),
495
+ "token_f1": round(token_f1, 6),
496
+ "anls": round(anls, 6),
497
+ "split": split,
498
+ "domain": row_metadata.get("domain", "unknown"),
499
+ "reasoning_type": row_metadata.get("reasoning_type", "unknown"),
500
+ }
501
+ )
502
+
503
+ extra_prediction_count = len(set(predictions) - set(gold_records))
504
+ return {
505
+ "gold_count": len(gold_records),
506
+ "prediction_count": len(predictions),
507
+ "evaluated_count": overall.summary()["count"],
508
+ "missing_prediction_count": missing_count,
509
+ "extra_prediction_count": extra_prediction_count,
510
+ "overall": overall.summary(),
511
+ "breakdowns": {
512
+ name: {key: bucket.summary() for key, bucket in sorted(group.items())}
513
+ for name, group in breakdowns.items()
514
+ },
515
+ "per_question": per_question,
516
+ }
517
+
518
+
519
+ def write_per_question_csv(rows: list[dict[str, Any]], output_path: Path) -> None:
520
+ output_path.parent.mkdir(parents=True, exist_ok=True)
521
+ fieldnames = [
522
+ "question_id",
523
+ "prediction",
524
+ "gold_answer",
525
+ "answer_format",
526
+ "status",
527
+ "accuracy",
528
+ "token_f1",
529
+ "anls",
530
+ "split",
531
+ "domain",
532
+ "reasoning_type",
533
+ ]
534
+ with output_path.open("w", encoding="utf-8", newline="") as handle:
535
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
536
+ writer.writeheader()
537
+ writer.writerows(rows)
538
+
539
+
540
+ def default_data_dir() -> Path:
541
+ script_dir = Path(__file__).resolve().parent
542
+ for data_dir in (script_dir / "data", script_dir.parent / "data"):
543
+ if data_dir.exists():
544
+ return data_dir
545
+ return script_dir.parent / "data"
546
+
547
+
548
+ def parse_args() -> argparse.Namespace:
549
+ parser = argparse.ArgumentParser(description="Evaluate XL-DocBench predictions")
550
+ parser.add_argument(
551
+ "--predictions", required=True, type=Path, help="Prediction JSON/JSONL file"
552
+ )
553
+ parser.add_argument(
554
+ "--data-dir",
555
+ type=Path,
556
+ default=default_data_dir(),
557
+ help="Directory containing QA JSONL files",
558
+ )
559
+ parser.add_argument(
560
+ "--gold-files",
561
+ nargs="+",
562
+ type=Path,
563
+ default=None,
564
+ help="Gold QA JSONL files; defaults to qa_single_doc and qa_cross_doc",
565
+ )
566
+ parser.add_argument(
567
+ "--prediction-field", default="", help="Optional explicit prediction field name"
568
+ )
569
+ parser.add_argument(
570
+ "--ignore-missing",
571
+ action="store_true",
572
+ help="Evaluate only questions present in the prediction file",
573
+ )
574
+ parser.add_argument(
575
+ "--output", type=Path, default=None, help="Write JSON report to this path"
576
+ )
577
+ parser.add_argument(
578
+ "--per-question-csv",
579
+ type=Path,
580
+ default=None,
581
+ help="Optional per-question CSV output",
582
+ )
583
+ parser.add_argument(
584
+ "--no-per-question-json",
585
+ action="store_true",
586
+ help="Omit per-question rows from the JSON report",
587
+ )
588
+ return parser.parse_args()
589
+
590
+
591
+ def main() -> None:
592
+ args = parse_args()
593
+ gold_files = args.gold_files
594
+ if gold_files is None:
595
+ gold_files = [
596
+ args.data_dir / "qa_single_doc.jsonl",
597
+ args.data_dir / "qa_cross_doc.jsonl",
598
+ ]
599
+
600
+ missing_gold_files = [str(path) for path in gold_files if not path.exists()]
601
+ if missing_gold_files:
602
+ raise FileNotFoundError(f"Gold file(s) not found: {missing_gold_files}")
603
+
604
+ gold_records = load_gold_records(gold_files)
605
+ predictions, statuses = load_predictions(args.predictions, args.prediction_field)
606
+ report = evaluate(
607
+ gold_records, predictions, statuses, ignore_missing=args.ignore_missing
608
+ )
609
+
610
+ if args.per_question_csv:
611
+ write_per_question_csv(report["per_question"], args.per_question_csv)
612
+ if args.no_per_question_json:
613
+ report = {key: value for key, value in report.items() if key != "per_question"}
614
+
615
+ if args.output:
616
+ args.output.parent.mkdir(parents=True, exist_ok=True)
617
+ args.output.write_text(
618
+ json.dumps(report, ensure_ascii=False, indent=2), encoding="utf-8"
619
+ )
620
+
621
+ overall = report["overall"]
622
+ print("XL-DocBench evaluation")
623
+ print(f" gold questions: {report['gold_count']}")
624
+ print(f" predictions: {report['prediction_count']}")
625
+ print(f" evaluated: {report['evaluated_count']}")
626
+ print(f" missing predictions: {report['missing_prediction_count']}")
627
+ print(f" extra predictions: {report['extra_prediction_count']}")
628
+ print(f" Accuracy: {overall['accuracy'] * 100:.2f}")
629
+ print(f" Token F1: {overall['token_f1'] * 100:.2f}")
630
+ print(f" ANLS: {overall['anls'] * 100:.2f}")
631
+
632
+
633
+ if __name__ == "__main__":
634
+ try:
635
+ main()
636
+ except (OSError, TypeError, ValueError) as exc:
637
+ print(f"ERROR: {exc}", file=sys.stderr)
638
+ sys.exit(1)
code/examples/gold_sample.jsonl ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {"question_id":"adubench_single_000001","question":"In the two executive summaries, which Chapter 1 phrase links pollution to human health more directly than Chapter 2’s climate-change wording?","answer":{"format":"Str","value":"the biggest single risk to human health worldwide","verification_rule":"casefold_exact_match"},"metadata":{"domain":"scientific_academic","reasoning_type":"comparison","difficulty":"hard","doc_type":"report"},"task_type":"single_doc"}
2
+ {"question_id":"adubench_single_000002","question":"Using Chapter 1's 'more than half' of 17 SDGs and Chapter 4's 12 GEO-6 entry-point issues, by how many percentage points does the minimum required issue share exceed 50%?","answer":{"format":"Int","value":"25","verification_rule":"numeric_tolerance"},"metadata":{"domain":"scientific_academic","reasoning_type":"compliance","difficulty":"very_hard","doc_type":"report"},"task_type":"single_doc"}
3
+ {"question_id":"adubench_single_000083","question":"По оглавлению, какой вводный раздел расположен ближе к «СОДЕРЖАНИЮ» по числу страниц — «ГЛАВНОЕ» или «ПРЕДИСЛОВИЕ» — и совпадает ли названная в обоих разделах программная рамка действий с «Повесткой-2030»","answer":{"format":"Str","value":"B","verification_rule":"choice_exact_match"},"metadata":{"domain":"scientific_academic","reasoning_type":"comparison","difficulty":"very_hard","doc_type":"report"},"task_type":"single_doc","options":["«ГЛАВНОЕ»; «Стратегическая рамочная программа ФАО на 2022–2031 годы»","«ГЛАВНОЕ»; «Повестка дня в области устойчивого развития на период до 2030 года»","«ПРЕДИСЛОВИЕ»; «Стратегия ФАО в области науки и инноваций»","«ПРЕДИСЛОВИЕ»; «Повестка дня в области устойчивого развития на период до 2030 года»"]}
4
+ {"question_id":"adubench_single_000193","question":"Across the sections titled \"Introduction\" and \"The year under review,\" what exact inflation target is named in the document’s discussion of inflation moving toward targets and then remaining above central bank targets?","answer":{"format":"None","value":"Not answerable","verification_rule":"exact_match"},"metadata":{"domain":"finance_business","reasoning_type":"compliance","difficulty":"medium","doc_type":"report"},"task_type":"single_doc"}
5
+ {"question_id":"adubench_cross_000001","question":"Which instrument category is named in both the French global measures discussion and the English framework-design discussion as a key tool?","answer":{"format":"Str","value":"macroprudential measures","verification_rule":"casefold_exact_match"},"metadata":{"domain":"finance_business","reasoning_type":"reference_chain","difficulty":"very_hard","doc_type":"cross_document_series"},"task_type":"cross_doc"}
code/examples/load_data.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Load XL-DocBench JSONL files with the Python standard library."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import json
8
+ from pathlib import Path
9
+
10
+
11
+ def parse_args() -> argparse.Namespace:
12
+ parser = argparse.ArgumentParser(description=__doc__)
13
+ parser.add_argument(
14
+ "--release-root",
15
+ type=Path,
16
+ default=Path(__file__).resolve().parents[2],
17
+ help="Release directory; defaults to the directory containing code/",
18
+ )
19
+ return parser.parse_args()
20
+
21
+
22
+ def read_jsonl(path: Path) -> list[dict]:
23
+ with path.open("r", encoding="utf-8") as handle:
24
+ return [json.loads(line) for line in handle if line.strip()]
25
+
26
+
27
+ def main() -> None:
28
+ root = parse_args().release_root.resolve()
29
+ documents = read_jsonl(root / "data/documents.jsonl")
30
+ single_doc = read_jsonl(root / "data/qa_single_doc.jsonl")
31
+ cross_doc = read_jsonl(root / "data/qa_cross_doc.jsonl")
32
+
33
+ print(f"documents: {len(documents):,}")
34
+ print(f"single_doc: {len(single_doc):,}")
35
+ print(f"cross_doc: {len(cross_doc):,}")
36
+ print(f"first question: {single_doc[0]['question']}")
37
+
38
+
39
+ if __name__ == "__main__":
40
+ main()
code/examples/predictions_sample.jsonl ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {"question_id":"adubench_single_000001","prediction":"the biggest single risk to human health worldwide"}
2
+ {"question_id":"adubench_single_000002","prediction":"25"}
3
+ {"question_id":"adubench_single_000083","prediction":"B"}
4
+ {"question_id":"adubench_single_000193","prediction":"Not answerable"}
5
+ {"question_id":"adubench_cross_000001","prediction":"macroprudential measures"}
code/quickstart.py ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Run a zero-dependency XL-DocBench release smoke test."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import json
8
+ import sys
9
+ from pathlib import Path
10
+ from typing import Any
11
+
12
+ sys.dont_write_bytecode = True
13
+
14
+ import evaluate as evaluator
15
+
16
+
17
+ def parse_args() -> argparse.Namespace:
18
+ parser = argparse.ArgumentParser(description=__doc__)
19
+ parser.add_argument(
20
+ "--release-root",
21
+ type=Path,
22
+ default=Path(__file__).resolve().parent.parent,
23
+ help="Release directory; defaults to the parent of code/",
24
+ )
25
+ return parser.parse_args()
26
+
27
+
28
+ def require(condition: bool, message: str) -> None:
29
+ if not condition:
30
+ raise ValueError(message)
31
+
32
+
33
+ def read_jsonl(path: Path) -> list[dict[str, Any]]:
34
+ rows: list[dict[str, Any]] = []
35
+ with path.open("r", encoding="utf-8") as handle:
36
+ for line_number, line in enumerate(handle, start=1):
37
+ if not line.strip():
38
+ continue
39
+ value = json.loads(line)
40
+ require(isinstance(value, dict), f"Expected object on {path}:{line_number}")
41
+ rows.append(value)
42
+ return rows
43
+
44
+
45
+ def row_documents(row: dict[str, Any]) -> list[dict[str, Any]]:
46
+ if row.get("task_type") == "single_doc":
47
+ document = row.get("document")
48
+ require(
49
+ isinstance(document, dict), f"Missing document in {row.get('question_id')}"
50
+ )
51
+ return [document]
52
+ documents = row.get("documents")
53
+ require(
54
+ isinstance(documents, list), f"Missing documents in {row.get('question_id')}"
55
+ )
56
+ return documents
57
+
58
+
59
+ def validate_release(release_root: Path) -> dict[str, int]:
60
+ manifest_path = release_root / "manifest.json"
61
+ require(manifest_path.is_file(), f"Missing {manifest_path}")
62
+ manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
63
+
64
+ release_files = manifest.get("release_files", {})
65
+ paths = {
66
+ name: release_root / release_files[name]
67
+ for name in ("documents", "single_doc_questions", "cross_doc_questions")
68
+ }
69
+ for path in paths.values():
70
+ require(path.is_file(), f"Missing release file: {path}")
71
+
72
+ documents = read_jsonl(paths["documents"])
73
+ single = read_jsonl(paths["single_doc_questions"])
74
+ cross = read_jsonl(paths["cross_doc_questions"])
75
+ questions = single + cross
76
+
77
+ require(len(documents) == manifest["document_count"], "Document count mismatch")
78
+ require(len(single) == manifest["single_doc_qa_count"], "Single-doc count mismatch")
79
+ require(len(cross) == manifest["cross_doc_qa_count"], "Cross-doc count mismatch")
80
+ require(len(questions) == manifest["qa_count"], "QA count mismatch")
81
+
82
+ document_ids = [str(document.get("document_id") or "") for document in documents]
83
+ question_ids = [str(row.get("question_id") or "") for row in questions]
84
+ require(all(document_ids), "Empty document_id")
85
+ require(all(question_ids), "Empty question_id")
86
+ require(len(set(document_ids)) == len(document_ids), "Duplicate document_id")
87
+ require(len(set(question_ids)) == len(question_ids), "Duplicate question_id")
88
+
89
+ known_documents = set(document_ids)
90
+ referenced_documents: set[str] = set()
91
+ evidence_item_count = 0
92
+ for row in questions:
93
+ question_id = row["question_id"]
94
+ require(
95
+ str(row.get("question") or "").strip(), f"Empty question: {question_id}"
96
+ )
97
+ require(isinstance(row.get("answer"), dict), f"Missing answer: {question_id}")
98
+ documents_for_row = row_documents(row)
99
+ metadata = row.get("metadata")
100
+ require(isinstance(metadata, dict), f"Missing metadata: {question_id}")
101
+ require(
102
+ metadata.get("n_context_documents") == len(documents_for_row),
103
+ f"Context-document count mismatch: {question_id}",
104
+ )
105
+
106
+ actual_evidence_documents = 0
107
+ for document in documents_for_row:
108
+ document_id = str(document.get("document_id") or "")
109
+ require(document_id in known_documents, f"Unknown document: {document_id}")
110
+ referenced_documents.add(document_id)
111
+ require(
112
+ document.get("evidence_page_numbering") == "pdf_index",
113
+ f"Missing evidence page semantics: {question_id}",
114
+ )
115
+ evidence_pages = document.get("evidence_pages")
116
+ evidence_items = document.get("evidence_items")
117
+ require(
118
+ isinstance(evidence_pages, list),
119
+ f"Invalid evidence_pages: {question_id}",
120
+ )
121
+ require(
122
+ isinstance(evidence_items, list),
123
+ f"Invalid evidence_items: {question_id}",
124
+ )
125
+ actual_evidence_documents += bool(evidence_pages or evidence_items)
126
+ evidence_item_count += len(evidence_items)
127
+ for item in evidence_items:
128
+ require(
129
+ str(item.get("locator") or "").strip(),
130
+ f"Empty locator: {question_id}",
131
+ )
132
+ require(bool(item.get("pages")), f"Empty item pages: {question_id}")
133
+ require(
134
+ item.get("page_numbering") == "annotator_supplied",
135
+ f"Missing item page semantics: {question_id}",
136
+ )
137
+ require(
138
+ item.get("evidence_kind")
139
+ in {"supporting_excerpt", "annotator_rationale"},
140
+ f"Invalid evidence kind: {question_id}",
141
+ )
142
+
143
+ require(
144
+ metadata.get("n_evidence_documents") == actual_evidence_documents,
145
+ f"Evidence-document count mismatch: {question_id}",
146
+ )
147
+ for item in row.get("unassigned_evidence_items", []):
148
+ require(
149
+ item.get("evidence_kind") == "unassigned_annotation",
150
+ f"Invalid unassigned evidence kind: {question_id}",
151
+ )
152
+
153
+ require(referenced_documents == known_documents, "Unreferenced released documents")
154
+ require(
155
+ evidence_item_count == manifest["evidence_item_count"],
156
+ "Evidence-item count mismatch",
157
+ )
158
+
159
+ score_path = release_root / release_files["per_question_scores"]
160
+ summary_path = release_root / release_files["score_summary"]
161
+ require(score_path.is_file(), f"Missing score file: {score_path}")
162
+ require(summary_path.is_file(), f"Missing score summary: {summary_path}")
163
+ score_rows = read_jsonl(score_path)
164
+ score_ids = [str(row.get("question_id") or "") for row in score_rows]
165
+ require(len(score_rows) == len(questions), "Per-question score count mismatch")
166
+ require(set(score_ids) == set(question_ids), "Per-question score IDs mismatch")
167
+ score_summary = json.loads(summary_path.read_text(encoding="utf-8"))
168
+ systems = score_summary.get("systems", {})
169
+ require(
170
+ len(systems) == manifest["scored_system_count"], "Scored-system count mismatch"
171
+ )
172
+ expected_systems = set(systems)
173
+ for row in score_rows:
174
+ row_scores = row.get("scores")
175
+ require(isinstance(row_scores, dict), "Invalid per-question scores")
176
+ require(set(row_scores) == expected_systems, "Per-question system mismatch")
177
+ for metrics in row_scores.values():
178
+ require(isinstance(metrics, dict), "Invalid metric record")
179
+ for metric in ("accuracy", "token_f1", "anls"):
180
+ value = metrics.get(metric)
181
+ require(
182
+ isinstance(value, (int, float)) and 0 <= value <= 1,
183
+ f"Invalid {metric} score",
184
+ )
185
+ return {
186
+ "documents": len(documents),
187
+ "single_doc": len(single),
188
+ "cross_doc": len(cross),
189
+ "questions": len(questions),
190
+ "evidence_items": evidence_item_count,
191
+ "systems": len(systems),
192
+ }
193
+
194
+
195
+ def evaluate_examples(code_dir: Path) -> dict[str, float | int]:
196
+ examples = code_dir / "examples"
197
+ gold = evaluator.load_gold_records([examples / "gold_sample.jsonl"])
198
+ predictions, statuses = evaluator.load_predictions(
199
+ examples / "predictions_sample.jsonl"
200
+ )
201
+ report = evaluator.evaluate(gold, predictions, statuses)
202
+ overall = report["overall"]
203
+ require(report["evaluated_count"] == 5, "Example evaluation count mismatch")
204
+ require(overall["accuracy"] == 1.0, "Example Accuracy regression")
205
+ require(overall["token_f1"] == 1.0, "Example Token F1 regression")
206
+ require(overall["anls"] == 1.0, "Example ANLS regression")
207
+ return overall
208
+
209
+
210
+ def main() -> None:
211
+ args = parse_args()
212
+ release_root = args.release_root.resolve()
213
+ counts = validate_release(release_root)
214
+ metrics = evaluate_examples(Path(__file__).resolve().parent)
215
+
216
+ print("XL-DocBench smoke test: PASS")
217
+ print(
218
+ f" data: {counts['documents']:,} documents, "
219
+ f"{counts['questions']:,} QA "
220
+ f"({counts['single_doc']:,} single + {counts['cross_doc']:,} cross)"
221
+ )
222
+ print(f" evidence items: {counts['evidence_items']:,}")
223
+ print(f" per-question scores: {counts['systems']} systems")
224
+ print(
225
+ f" sample metrics: Accuracy={metrics['accuracy'] * 100:.1f}, "
226
+ f"F1={metrics['token_f1'] * 100:.1f}, ANLS={metrics['anls'] * 100:.1f}"
227
+ )
228
+
229
+
230
+ if __name__ == "__main__":
231
+ try:
232
+ main()
233
+ except (KeyError, OSError, TypeError, ValueError, json.JSONDecodeError) as exc:
234
+ print(f"XL-DocBench smoke test: FAIL — {exc}", file=sys.stderr)
235
+ sys.exit(1)
data/documents.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/qa_cross_doc.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/qa_single_doc.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
manifest.json ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "annotation_not_answerable_non_none_count": 1,
3
+ "answer_format_counts": {
4
+ "Float": 110,
5
+ "Int": 209,
6
+ "None": 188,
7
+ "Str": 838
8
+ },
9
+ "cross_doc_context_document_count_distribution": {
10
+ "10": 19,
11
+ "12": 4,
12
+ "2": 4,
13
+ "3": 14,
14
+ "4": 17,
15
+ "5": 8,
16
+ "6": 20,
17
+ "7": 19,
18
+ "8": 47,
19
+ "9": 2
20
+ },
21
+ "cross_doc_evidence_document_count_distribution": {
22
+ "0": 18,
23
+ "2": 79,
24
+ "3": 45,
25
+ "4": 12
26
+ },
27
+ "cross_doc_qa_count": 154,
28
+ "document_count": 292,
29
+ "domain_counts": {
30
+ "finance_business": 329,
31
+ "legal_regulation": 275,
32
+ "medical_clinical": 233,
33
+ "narrative_literature": 81,
34
+ "scientific_academic": 189,
35
+ "technical_engineering": 238
36
+ },
37
+ "empty_evidence_qa_count": 189,
38
+ "evidence_item_count": 3044,
39
+ "page_indexing": "Document evidence_pages use one-based PDF/release page indices. Evidence-item pages preserve annotator-supplied page references and use page_numbering=annotator_supplied; printed page labels can differ from PDF indices. Items marked annotator_rationale are review explanations rather than verbatim document excerpts. Row-level items marked unassigned_annotation are retained provenance that is not counted as released evidence. Rows released without supporting evidence have empty evidence arrays and n_evidence_documents=0.",
40
+ "qa_count": 1345,
41
+ "reasoning_type_counts": {
42
+ "aggregation": 44,
43
+ "comparison": 200,
44
+ "compliance": 59,
45
+ "consistency": 19,
46
+ "counterfactual": 56,
47
+ "coverage": 163,
48
+ "ranking": 156,
49
+ "reconciliation": 107,
50
+ "reference_chain": 206,
51
+ "set_difference": 101,
52
+ "temporal": 50,
53
+ "unanswerable": 184
54
+ },
55
+ "release_files": {
56
+ "cross_doc_questions": "data/qa_cross_doc.jsonl",
57
+ "documents": "data/documents.jsonl",
58
+ "per_question_scores": "results/scores.jsonl",
59
+ "score_summary": "results/summary.json",
60
+ "single_doc_questions": "data/qa_single_doc.jsonl"
61
+ },
62
+ "release_version": "xldocbench_strict_1345_v1",
63
+ "score_evaluator_sha256": "efc56cb25ba136e09ceaccb5d8006ea9461f71a68998f2987073387682a5e547",
64
+ "scored_system_count": 13,
65
+ "single_doc_qa_count": 1191,
66
+ "unanswerable_qa_count": 188,
67
+ "unassigned_evidence_item_count": 11,
68
+ "url_mapping_coverage": "292/292",
69
+ "variant_info": {
70
+ "variant": "strict_excluding_rag_not_approved",
71
+ "source_git_revision": "dd2aa7fcc241c6fe0b2e5b315c220460e0f2ab94",
72
+ "match_method": "exact_source_url",
73
+ "filter_rule": "Remove documents with RAG / Not Approved status and every QA row that references one of those documents, then prune documents left with no QA references.",
74
+ "rag_restricted_document_count": 37,
75
+ "orphaned_document_count": 2,
76
+ "removed_document_count": 39,
77
+ "removed_qa_count": 174
78
+ }
79
+ }
results/scores.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
results/summary.json ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset_variant": "strict_excluding_rag_not_approved",
3
+ "question_count": 1345,
4
+ "evaluator": "code/evaluate.py",
5
+ "evaluator_sha256": "efc56cb25ba136e09ceaccb5d8006ea9461f71a68998f2987073387682a5e547",
6
+ "score_scale": "0_to_1",
7
+ "systems": {
8
+ "gpt_5_2_img": {
9
+ "name": "GPT-5.2",
10
+ "input": "img",
11
+ "accuracy": 0.2171,
12
+ "token_f1": 0.249504,
13
+ "anls": 0.219197
14
+ },
15
+ "gpt_5_2_ocr": {
16
+ "name": "GPT-5.2",
17
+ "input": "ocr",
18
+ "accuracy": 0.311524,
19
+ "token_f1": 0.336904,
20
+ "anls": 0.285114
21
+ },
22
+ "gpt_5_4_img": {
23
+ "name": "GPT-5.4",
24
+ "input": "img",
25
+ "accuracy": 0.267658,
26
+ "token_f1": 0.297605,
27
+ "anls": 0.263317
28
+ },
29
+ "gpt_5_4_ocr": {
30
+ "name": "GPT-5.4",
31
+ "input": "ocr",
32
+ "accuracy": 0.383643,
33
+ "token_f1": 0.397047,
34
+ "anls": 0.341731
35
+ },
36
+ "kimi_k2_5_img": {
37
+ "name": "Kimi-K2.5",
38
+ "input": "img",
39
+ "accuracy": 0.260223,
40
+ "token_f1": 0.275877,
41
+ "anls": 0.230395
42
+ },
43
+ "kimi_k2_5_ocr": {
44
+ "name": "Kimi-K2.5",
45
+ "input": "ocr",
46
+ "accuracy": 0.360595,
47
+ "token_f1": 0.382426,
48
+ "anls": 0.326386
49
+ },
50
+ "deepseek_v3_2_ocr": {
51
+ "name": "DeepSeek-V3.2",
52
+ "input": "ocr",
53
+ "accuracy": 0.296654,
54
+ "token_f1": 0.329908,
55
+ "anls": 0.289058
56
+ },
57
+ "qwen3_5_4b_img": {
58
+ "name": "Qwen3.5-4B",
59
+ "input": "img",
60
+ "accuracy": 0.205204,
61
+ "token_f1": 0.208648,
62
+ "anls": 0.182636
63
+ },
64
+ "qwen3_5_4b_ocr": {
65
+ "name": "Qwen3.5-4B",
66
+ "input": "ocr",
67
+ "accuracy": 0.289963,
68
+ "token_f1": 0.32228,
69
+ "anls": 0.28128
70
+ },
71
+ "qwen3_5_9b_img": {
72
+ "name": "Qwen3.5-9B",
73
+ "input": "img",
74
+ "accuracy": 0.20223,
75
+ "token_f1": 0.226944,
76
+ "anls": 0.20179
77
+ },
78
+ "simpledoc_gpt_5_4": {
79
+ "name": "SimpleDoc + GPT-5.4",
80
+ "input": "agent",
81
+ "accuracy": 0.362082,
82
+ "token_f1": 0.336157,
83
+ "anls": 0.242958
84
+ },
85
+ "mdocagent_gpt_5_4": {
86
+ "name": "MDocAgent + GPT-5.4",
87
+ "input": "agent",
88
+ "accuracy": 0.318216,
89
+ "token_f1": 0.305814,
90
+ "anls": 0.226412
91
+ },
92
+ "deepread_gpt_5_4": {
93
+ "name": "DeepRead + GPT-5.4",
94
+ "input": "agent",
95
+ "accuracy": 0.277323,
96
+ "token_f1": 0.269935,
97
+ "anls": 0.211733
98
+ }
99
+ },
100
+ "scores_sha256": "d3db5e13eaa19ce1cd6776eb5ed8dc243dcc166109884f21d668bfe86c3de39a"
101
+ }
schema/release_format_sample.json ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "variant": "strict_excluding_rag_not_approved",
3
+ "evidence_semantics": "Document evidence_pages use one-based PDF/release page indices. Evidence-item pages preserve annotator-supplied page references and use page_numbering=annotator_supplied; printed page labels can differ from PDF indices. Items marked annotator_rationale are review explanations rather than verbatim document excerpts. Row-level items marked unassigned_annotation are retained provenance that is not counted as released evidence. Rows released without supporting evidence have empty evidence arrays and n_evidence_documents=0.",
4
+ "document_manifest_sample": {
5
+ "avg_chars_per_page": 2690.8,
6
+ "doc_type": "report",
7
+ "document_id": "doc_000001",
8
+ "domain": "finance_business",
9
+ "file_size_bytes": 4609256,
10
+ "image_page_ratio": 0.0,
11
+ "page_count": 204,
12
+ "pdf_type": "native_digital",
13
+ "public_metadata": {
14
+ "authors": [
15
+ "Ashley Alder"
16
+ ],
17
+ "company": "Financial Conduct Authority",
18
+ "content_year": 2023,
19
+ "content_year_range": "2022-2023",
20
+ "governing_body": "UK Parliament (House of Commons)",
21
+ "language": "English",
22
+ "organization": "Financial Conduct Authority",
23
+ "report_period": "FY2022/23 (year ended 31 March 2023)",
24
+ "sector": "Financial regulation",
25
+ "ticker": null
26
+ },
27
+ "source_host": "www.fca.org.uk",
28
+ "text_page_ratio": 0.95,
29
+ "title": "Annual Report and Accounts 2022/23",
30
+ "url": "https://www.fca.org.uk/publication/annual-reports/annual-report-2022-23.pdf"
31
+ },
32
+ "qa_single_doc_sample": {
33
+ "answer": {
34
+ "format": "Str",
35
+ "value": "the biggest single risk to human health worldwide",
36
+ "verification_rule": "casefold_exact_match"
37
+ },
38
+ "document": {
39
+ "document_id": "doc_000002",
40
+ "evidence_items": [
41
+ {
42
+ "locator": "Page 37",
43
+ "mentioned_elements": [],
44
+ "pages": [
45
+ 37
46
+ ],
47
+ "quote": "Human activities are causing increasing amounts of pollution, to the extent that this is now recognised as the biggest single risk to human health worldwide",
48
+ "source_type": "Text",
49
+ "evidence_kind": "supporting_excerpt",
50
+ "page_numbering": "annotator_supplied"
51
+ },
52
+ {
53
+ "locator": "Page 38",
54
+ "mentioned_elements": [],
55
+ "pages": [
56
+ 38
57
+ ],
58
+ "quote": "It emphasizes that a healthy planet is a necessary foundation for human physical, psychological, social, economic and emotional health and well-being",
59
+ "source_type": "Text",
60
+ "evidence_kind": "supporting_excerpt",
61
+ "page_numbering": "annotator_supplied"
62
+ },
63
+ {
64
+ "locator": "Page 40",
65
+ "mentioned_elements": [],
66
+ "pages": [
67
+ 40
68
+ ],
69
+ "quote": "Throughout GEO-6, evidence is presented of how fundamentally nature’s contributions to people underpin human health and well-being.",
70
+ "source_type": "Text",
71
+ "evidence_kind": "supporting_excerpt",
72
+ "page_numbering": "annotator_supplied"
73
+ },
74
+ {
75
+ "locator": "Page 55",
76
+ "mentioned_elements": [],
77
+ "pages": [
78
+ 55
79
+ ],
80
+ "quote": "Climate change poses risks to human societies through impacts on food, and water security (established but incomplete), and on human security, health, livelihoods and infrastructure.",
81
+ "source_type": "Text",
82
+ "evidence_kind": "supporting_excerpt",
83
+ "page_numbering": "annotator_supplied"
84
+ },
85
+ {
86
+ "locator": "Page 57",
87
+ "mentioned_elements": [],
88
+ "pages": [
89
+ 57
90
+ ],
91
+ "quote": "Likewise, climate change has been added as a fifth driver",
92
+ "source_type": "Text",
93
+ "evidence_kind": "supporting_excerpt",
94
+ "page_numbering": "annotator_supplied"
95
+ },
96
+ {
97
+ "locator": "Page 57",
98
+ "mentioned_elements": [],
99
+ "pages": [
100
+ 57
101
+ ],
102
+ "quote": "In the absence of an adequate response, a changing climate could lead to a pre-modern world of famine, plague, war, and premature death.",
103
+ "source_type": "Text",
104
+ "evidence_kind": "supporting_excerpt",
105
+ "page_numbering": "annotator_supplied"
106
+ }
107
+ ],
108
+ "evidence_pages": [
109
+ 37,
110
+ 38,
111
+ 39,
112
+ 40,
113
+ 42,
114
+ 43,
115
+ 44,
116
+ 45,
117
+ 55,
118
+ 56,
119
+ 57,
120
+ 58,
121
+ 65,
122
+ 66,
123
+ 67,
124
+ 68,
125
+ 72,
126
+ 73,
127
+ 74,
128
+ 75
129
+ ],
130
+ "url": "https://digitallibrary.un.org/nanna/record/4008190/files/GEO6_2019.pdf?registerDownload=1&version=1&withMetadata=0&withWatermark=0",
131
+ "evidence_page_numbering": "pdf_index"
132
+ },
133
+ "metadata": {
134
+ "difficulty": "hard",
135
+ "doc_type": "report",
136
+ "doc_type_coarse": "Technical document",
137
+ "domain": "scientific_academic",
138
+ "evidence_annotation_status": "has_evidence",
139
+ "evidence_sources": [
140
+ "Text"
141
+ ],
142
+ "is_unanswerable": false,
143
+ "n_context_documents": 1,
144
+ "n_evidence_documents": 1,
145
+ "reasoning_type": "comparison",
146
+ "n_candidate_evidence_documents": 1,
147
+ "candidate_evidence_sources": [
148
+ "Text"
149
+ ],
150
+ "answerability_conflict": false
151
+ },
152
+ "question": "In the two executive summaries, which Chapter 1 phrase links pollution to human health more directly than Chapter 2’s climate-change wording?",
153
+ "question_id": "adubench_single_000001",
154
+ "task_type": "single_doc"
155
+ },
156
+ "qa_cross_doc_sample": {
157
+ "answer": {
158
+ "format": "Str",
159
+ "value": "macroprudential measures",
160
+ "verification_rule": "casefold_exact_match"
161
+ },
162
+ "documents": [
163
+ {
164
+ "document_id": "doc_000126",
165
+ "evidence_items": [
166
+ {
167
+ "locator": "Doc1, Page 17",
168
+ "mentioned_elements": [],
169
+ "pages": [
170
+ 17
171
+ ],
172
+ "quote": "The activation of macroprudential measures is especially important at the current juncture. It can help contain the financial vulnerabilities bequeathed by the unbalanced post-crisis recovery and mitigate the build-up of further risks.",
173
+ "source_type": "Text",
174
+ "evidence_kind": "supporting_excerpt",
175
+ "page_numbering": "annotator_supplied"
176
+ }
177
+ ],
178
+ "evidence_pages": [
179
+ 11,
180
+ 12,
181
+ 13,
182
+ 14,
183
+ 15,
184
+ 16,
185
+ 17
186
+ ],
187
+ "url": "https://www.bis.org/publ/arpdf/ar2018e.pdf",
188
+ "evidence_page_numbering": "pdf_index"
189
+ },
190
+ {
191
+ "document_id": "doc_000115",
192
+ "evidence_items": [],
193
+ "evidence_pages": [],
194
+ "url": "https://www.bis.org/publ/arpdf/ar2018_it.pdf",
195
+ "evidence_page_numbering": "pdf_index"
196
+ },
197
+ {
198
+ "document_id": "doc_000290",
199
+ "evidence_items": [
200
+ {
201
+ "locator": "Doc2, Page 11",
202
+ "mentioned_elements": [],
203
+ "pages": [
204
+ 11
205
+ ],
206
+ "quote": "Le renforcement de la résilience passe aussi par le déploiement actif de mesures macroprudentielles dans les économies où les déséquilibres financiers se sont accumulés, et, plus généralement, par l'amélioration des dispositifs macroprudentiels.",
207
+ "source_type": "Text",
208
+ "evidence_kind": "supporting_excerpt",
209
+ "page_numbering": "annotator_supplied"
210
+ }
211
+ ],
212
+ "evidence_pages": [
213
+ 5,
214
+ 6,
215
+ 7,
216
+ 8,
217
+ 9,
218
+ 10,
219
+ 11,
220
+ 12,
221
+ 13,
222
+ 14,
223
+ 15
224
+ ],
225
+ "url": "https://www.bis.org/publ/arpdf/ar2018_fr.pdf",
226
+ "evidence_page_numbering": "pdf_index"
227
+ },
228
+ {
229
+ "document_id": "doc_000323",
230
+ "evidence_items": [],
231
+ "evidence_pages": [],
232
+ "url": "https://www.bis.org/publ/arpdf/ar2018_es.pdf",
233
+ "evidence_page_numbering": "pdf_index"
234
+ },
235
+ {
236
+ "document_id": "doc_000136",
237
+ "evidence_items": [],
238
+ "evidence_pages": [],
239
+ "url": "https://www.bis.org/publ/arpdf/ar2023e.pdf",
240
+ "evidence_page_numbering": "pdf_index"
241
+ },
242
+ {
243
+ "document_id": "doc_000101",
244
+ "evidence_items": [],
245
+ "evidence_pages": [],
246
+ "url": "https://www.bis.org/publ/arpdf/ar2024e.pdf",
247
+ "evidence_page_numbering": "pdf_index"
248
+ }
249
+ ],
250
+ "metadata": {
251
+ "difficulty": "very_hard",
252
+ "doc_type": "cross_document_series",
253
+ "doc_type_coarse": "Cross-document series",
254
+ "domain": "finance_business",
255
+ "evidence_annotation_status": "has_evidence",
256
+ "evidence_sources": [
257
+ "Text"
258
+ ],
259
+ "is_unanswerable": false,
260
+ "n_context_documents": 6,
261
+ "n_evidence_documents": 2,
262
+ "reasoning_type": "reference_chain",
263
+ "n_candidate_evidence_documents": 2,
264
+ "candidate_evidence_sources": [
265
+ "Text"
266
+ ],
267
+ "answerability_conflict": false
268
+ },
269
+ "question": "Which instrument category is named in both the French global measures discussion and the English framework-design discussion as a key tool?",
270
+ "question_id": "adubench_cross_000001",
271
+ "task_type": "cross_doc"
272
+ }
273
+ }