Add paper link, code link, and citation information

#2
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +217 -204
README.md CHANGED
@@ -1,204 +1,217 @@
1
- ---
2
- license: unknown
3
- task_categories:
4
- - object-detection
5
- - image-segmentation
6
- tags:
7
- - pdf
8
- - document-layout-analysis
9
- - data-extraction
10
- language:
11
- - en
12
- - fr
13
- - es
14
- size_categories:
15
- - n<1K
16
- configs:
17
- - config_name: annotations
18
- data_files:
19
- - split: unhcr
20
- path: "annotations/unhcr/*.json"
21
- - split: prwp
22
- path: "annotations/prwp/*.json"
23
- - split: refugee
24
- path: "annotations/refugee/*.json"
25
- - config_name: metadata
26
- data_files:
27
- - split: unhcr
28
- path: "metadata/unhcr/*.json"
29
- - split: prwp
30
- path: "metadata/prwp/*.json"
31
- - split: refugee
32
- path: "metadata/refugee/*.json"
33
- - config_name: documents
34
- data_files:
35
- - split: unhcr
36
- path: "documents/unhcr/*.pdf"
37
- - split: prwp
38
- path: "documents/prwp/*.pdf"
39
- - split: refugee
40
- path: "documents/refugee/*.pdf"
41
- - config_name: snapshots
42
- data_files:
43
- - split: unhcr
44
- path: "snapshots/unhcr/*.png"
45
- - split: prwp
46
- path: "snapshots/prwp/*.png"
47
- - split: refugee
48
- path: "snapshots/refugee/*.png"
49
- ---
50
-
51
- # Dataset card for data-snapshot
52
-
53
- ## Dataset summary
54
- The `data-snapshot` dataset is an annotated corpus designed for the evaluation and development of models for extracting *data snapshots* from PDF documents. A **data snapshot** is defined as a figure or table that contains quantitative data derived from statistics, indicators, or structured data sources.
55
-
56
- ## Dataset structure
57
-
58
- The repository is organized as follows:
59
-
60
- ```
61
- ai4data/data-snapshot/
62
- ├── annotations/<source>/*.json # Contains annotation files per document
63
- ├── documents/<source>/*.pdf # Actual PDFs
64
- ├── metadata/<source>/*.json # Document-level metadata
65
- ├── schemas/*.json # Provides the schema of the annotation and metadata files
66
- ├── snapshots/<source>/*.png # Image files corresponding to the annotations
67
- └── README.md
68
- ```
69
-
70
- ### Subsets
71
- - `annotations`
72
- - JSON files that indicate the data snapshots: their object class (Figure / Table) and bounding box locations (in normalized `[x1, y1, x2, y2]` format, top-left origin)
73
- - Follows the schema provided in `schemas/data-snapshot-eval-v1.3.schema.json`
74
- - Provided on a per-document basis; documents that do not have data snapshots will still have an annotation file present but list of bounding boxes will be empty.
75
- - `documents`
76
- - Actual PDF files that were annotated
77
- - `metadata`
78
- - Document-level metadata following the [World Bank Metadata Standards (Chapter 5 — Documents)](https://worldbank.github.io/schema-guide/chapter05.html), schema provided in `schemas/metadata_schema.json`.
79
- - Provided on a per-document basis
80
- - All files across all sources share a uniform schema (same keys at every nesting level)
81
- - `snapshots`
82
- - PNG files extracted from the documents and bounding box locations
83
-
84
- ### Sources
85
- - UNHCR
86
- - PRWP
87
- - Refugee
88
-
89
- ## Loading the dataset using HF's `datasets` library
90
-
91
- ### Annotations
92
-
93
- ```python
94
- >>> from datasets import load_dataset
95
- >>> annotations = load_dataset("ai4data/data-snapshot", name="annotations", split="unhcr")
96
- >>> annotations[0] # Inspect the first record
97
- {'label_map': {'1': 'Figure', '2': 'Table'}, 'info': {'schema_version': '1.3', 'type': 'ground_truth', 'created_at': datetime.datetime(2026, 5, 20, 13, 44, 29), 'run_id': 'human-annotation-combined-e3432dce89', 'model': {'name': 'human annotation'}, 'coordinate_system': {'type': 'normalized_xyxy', 'range': [0.0, 1.0], 'origin': 'top_left'}}, 'documents': [{'doc_id': '06072015-baalbek-hermelgovernorateprofile.pdf', 'doc_name': '06072015-baalbek-hermelgovernorateprofile.pdf', 'doc_path': 'pdf_input/06072015-baalbek-hermelgovernorateprofile.pdf'}], 'predictions': [{'page_id': '06072015-baalbek-hermelgovernorateprofile.pdf::p000', 'doc_id': '06072015-baalbek-hermelgovernorateprofile.pdf', 'page_index': 0, 'objects': [{'id': '1d69f693', 'label': 'Figure', 'bbox': [0.029415499554572243, 0.1766403810171256, 0.5954839424856321, 0.7354445202645015], 'score': None}, ...}
98
- ```
99
-
100
- ### Metadata
101
-
102
- ```python
103
- >>> metadata = load_dataset("ai4data/data-snapshot", name="metadata", split="unhcr")
104
- >>> metadata[0] # Inspect the first record
105
- {'type': 'document', 'metadata_information': {'title': 'Lebanon: Baalbek-Hermel Governorate Profile (June 2015)', 'idno': '06072015-baalbek-hermelgovernorateprofile', 'producers': [{'name': 'UNHCR', 'abbr': 'UNHCR', 'affiliation': 'UNHCR', 'role': 'Source'}], 'production_date': datetime.datetime(2026, 5, 21, 0, 0), ...}
106
- ```
107
-
108
- ### Documents
109
-
110
- ```python
111
- >>> docs = load_dataset("ai4data/data-snapshot", data_dir="documents/unhcr") # Or simply data_dir="documents/" for all files
112
- >>> docs.save_to_disk("path/to/docs_directory") # Files are saved as an Arrow file
113
- ```
114
-
115
- ### Snapshots
116
-
117
- ```python
118
- >>> snapshots = load_dataset("ai4data/data-snapshot", data_dir="snapshots/unhcr") # Or simply data_dir="snapshots/" for all snapshots
119
- >>> snapshots.save_to_disk("path/to/snapshots_directory") # Files are saved as an Arrow file
120
- ```
121
-
122
- ## Schema
123
-
124
- ### Annotations
125
-
126
- The annotation files follow the **Data Snapshot Evaluation Format (v1.3)**. Below is a simplified, human-readable example of the JSON schema with explanatory comments for each field.
127
-
128
- > **Note**: You will notice a top-level field called `predictions`. In the context of this dataset, this is a misnomer because these are actually human-labeled **annotations** (ground truth). We use the key `predictions` because we borrow this schema from the project's evaluation codebase, which uses a unified structure for both ground truth and model predictions.
129
-
130
- ```json
131
- {
132
- // Canonical mapping of integer IDs to class names
133
- "label_map": {
134
- "1": "Figure",
135
- "2": "Table"
136
- },
137
-
138
- // High-level metadata about the file
139
- "info": {
140
- "schema_version": "1.3",
141
- "type": "ground_truth", // Indicates these are human annotations
142
- "created_at": "2026-05-20T13:44:29",
143
- "run_id": "human-annotation-combined-e3432dce89",
144
- "model": {
145
- "name": "human annotation"
146
- },
147
- "coordinate_system": {
148
- "type": "normalized_xyxy",
149
- "range": [0.0, 1.0], // Bounding boxes are normalized between 0 and 1
150
- "origin": "top_left"
151
- }
152
- },
153
-
154
- // List of documents referenced in this file
155
- "documents": [
156
- {
157
- "doc_id": "1_advocacy_note_mineaction_-_niger_eng.pdf",
158
- "doc_name": "1_advocacy_note_mineaction_-_niger_eng.pdf",
159
- "doc_path": "pdf_input/1_advocacy_note_mineaction_-_niger_eng.pdf"
160
- }
161
- ],
162
-
163
- // Per-page container of objects; these contain the ground truth annotations
164
- "predictions": [
165
- {
166
- "page_id": "1_advocacy_note_mineaction_-_niger_eng.pdf::p001",
167
- "doc_id": "1_advocacy_note_mineaction_-_niger_eng.pdf",
168
- "page_index": 0, // 0-indexed page number
169
- "objects": [
170
- {
171
- "id": "obj_001",
172
- "label": "Figure", // Matches a label_map entry
173
- "bbox": [0.029, 0.177, 0.595, 0.735], // Normalized [x_min, y_min, x_max, y_max]
174
- "score": null // Always null for ground truth
175
- }
176
- ]
177
- }
178
- ]
179
- }
180
- ```
181
-
182
- ### Metadata
183
-
184
- The metadata files follow the [**World Bank Document Metadata Schema**](https://worldbank.github.io/schema-guide/chapter05.html). See `schemas/metadata_schema.json` for the formal JSON schema definition.
185
-
186
- All metadata files across all sources share a uniform schema (same keys at every nesting level, same types) to ensure compatibility with Apache Arrow and HuggingFace streaming.
187
-
188
- Top-level fields:
189
- - `type`
190
- - `metadata_information`
191
- - `document_description`
192
- - `provenance`
193
- - `tags`
194
- - `schematype`
195
- - `additional` - contains source-specific fields (e.g. `additional.unhcr_*` for UNHCR, `additional.wds_*` for WDS API-sourced datasets).
196
-
197
- ## Dataset creation
198
- The annotations were produced through human labeling using Label Studio.
199
-
200
- ## Licensing information
201
- [TBD]
202
-
203
- ## Citation information
204
- [TBD]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - fr
5
+ - es
6
+ license: unknown
7
+ size_categories:
8
+ - n<1K
9
+ task_categories:
10
+ - object-detection
11
+ - image-segmentation
12
+ tags:
13
+ - pdf
14
+ - document-layout-analysis
15
+ - data-extraction
16
+ configs:
17
+ - config_name: annotations
18
+ data_files:
19
+ - split: unhcr
20
+ path: annotations/unhcr/*.json
21
+ - split: prwp
22
+ path: annotations/prwp/*.json
23
+ - split: refugee
24
+ path: annotations/refugee/*.json
25
+ - config_name: metadata
26
+ data_files:
27
+ - split: unhcr
28
+ path: metadata/unhcr/*.json
29
+ - split: prwp
30
+ path: metadata/prwp/*.json
31
+ - split: refugee
32
+ path: metadata/refugee/*.json
33
+ - config_name: documents
34
+ data_files:
35
+ - split: unhcr
36
+ path: documents/unhcr/*.pdf
37
+ - split: prwp
38
+ path: documents/prwp/*.pdf
39
+ - split: refugee
40
+ path: documents/refugee/*.pdf
41
+ - config_name: snapshots
42
+ data_files:
43
+ - split: unhcr
44
+ path: snapshots/unhcr/*.png
45
+ - split: prwp
46
+ path: snapshots/prwp/*.png
47
+ - split: refugee
48
+ path: snapshots/refugee/*.png
49
+ ---
50
+
51
+ # Dataset card for data-snapshot
52
+
53
+ This dataset was introduced in the paper [Benchmarking Open-Source Layout Detection Models for Data Snapshot Extraction from Institutional Documents](https://huggingface.co/papers/2606.06242).
54
+
55
+ The source code for the benchmark and dataset extraction is available on GitHub: [worldbank/ai4data](https://github.com/worldbank/ai4data/tree/main/experimental/data-snapshot).
56
+
57
+ ## Dataset summary
58
+ The `data-snapshot` dataset is an annotated corpus designed for the evaluation and development of models for extracting *data snapshots* from PDF documents. A **data snapshot** is defined as a figure or table that contains quantitative data derived from statistics, indicators, or structured data sources.
59
+
60
+ The benchmark spans humanitarian reports, World Bank policy research working papers, and project appraisal documents, and includes annotations for figures and tables that contain reusable analytical information.
61
+
62
+ ## Dataset structure
63
+
64
+ The repository is organized as follows:
65
+
66
+ ```
67
+ ai4data/data-snapshot/
68
+ ├── annotations/<source>/*.json # Contains annotation files per document
69
+ ├── documents/<source>/*.pdf # Actual PDFs
70
+ ├── metadata/<source>/*.json # Document-level metadata
71
+ ├── schemas/*.json # Provides the schema of the annotation and metadata files
72
+ ├── snapshots/<source>/*.png # Image files corresponding to the annotations
73
+ └── README.md
74
+ ```
75
+
76
+ ### Subsets
77
+ - `annotations`
78
+ - JSON files that indicate the data snapshots: their object class (Figure / Table) and bounding box locations (in normalized `[x1, y1, x2, y2]` format, top-left origin)
79
+ - Follows the schema provided in `schemas/data-snapshot-eval-v1.3.schema.json`
80
+ - Provided on a per-document basis; documents that do not have data snapshots will still have an annotation file present but list of bounding boxes will be empty.
81
+ - `documents`
82
+ - Actual PDF files that were annotated
83
+ - `metadata`
84
+ - Document-level metadata following the [World Bank Metadata Standards (Chapter 5 — Documents)](https://worldbank.github.io/schema-guide/chapter05.html), schema provided in `schemas/metadata_schema.json`.
85
+ - Provided on a per-document basis
86
+ - All files across all sources share a uniform schema (same keys at every nesting level)
87
+ - `snapshots`
88
+ - PNG files extracted from the documents and bounding box locations
89
+
90
+ ### Sources
91
+ - UNHCR
92
+ - PRWP
93
+ - Refugee
94
+
95
+ ## Loading the dataset using HF's `datasets` library
96
+
97
+ ### Annotations
98
+
99
+ ```python
100
+ >>> from datasets import load_dataset
101
+ >>> annotations = load_dataset("ai4data/data-snapshot", name="annotations", split="unhcr")
102
+ >>> annotations[0] # Inspect the first record
103
+ {'label_map': {'1': 'Figure', '2': 'Table'}, 'info': {'schema_version': '1.3', 'type': 'ground_truth', 'created_at': datetime.datetime(2026, 5, 20, 13, 44, 29), 'run_id': 'human-annotation-combined-e3432dce89', 'model': {'name': 'human annotation'}, 'coordinate_system': {'type': 'normalized_xyxy', 'range': [0.0, 1.0], 'origin': 'top_left'}}, 'documents': [{'doc_id': '06072015-baalbek-hermelgovernorateprofile.pdf', 'doc_name': '06072015-baalbek-hermelgovernorateprofile.pdf', 'doc_path': 'pdf_input/06072015-baalbek-hermelgovernorateprofile.pdf'}], 'predictions': [{'page_id': '06072015-baalbek-hermelgovernorateprofile.pdf::p000', 'doc_id': '06072015-baalbek-hermelgovernorateprofile.pdf', 'page_index': 0, 'objects': [{'id': '1d69f693', 'label': 'Figure', 'bbox': [0.029415499554572243, 0.1766403810171256, 0.5954839424856321, 0.7354445202645015], 'score': None}, ...}
104
+ ```
105
+
106
+ ### Metadata
107
+
108
+ ```python
109
+ >>> metadata = load_dataset("ai4data/data-snapshot", name="metadata", split="unhcr")
110
+ >>> metadata[0] # Inspect the first record
111
+ {'type': 'document', 'metadata_information': {'title': 'Lebanon: Baalbek-Hermel Governorate Profile (June 2015)', 'idno': '06072015-baalbek-hermelgovernorateprofile', 'producers': [{'name': 'UNHCR', 'abbr': 'UNHCR', 'affiliation': 'UNHCR', 'role': 'Source'}], 'production_date': datetime.datetime(2026, 5, 21, 0, 0), ...}
112
+ ```
113
+
114
+ ### Documents
115
+
116
+ ```python
117
+ >>> docs = load_dataset("ai4data/data-snapshot", data_dir="documents/unhcr") # Or simply data_dir="documents/" for all files
118
+ >>> docs.save_to_disk("path/to/docs_directory") # Files are saved as an Arrow file
119
+ ```
120
+
121
+ ### Snapshots
122
+
123
+ ```python
124
+ >>> snapshots = load_dataset("ai4data/data-snapshot", data_dir="snapshots/unhcr") # Or simply data_dir="snapshots/" for all snapshots
125
+ >>> snapshots.save_to_disk("path/to/snapshots_directory") # Files are saved as an Arrow file
126
+ ```
127
+
128
+ ## Schema
129
+
130
+ ### Annotations
131
+
132
+ The annotation files follow the **Data Snapshot Evaluation Format (v1.3)**. Below is a simplified, human-readable example of the JSON schema with explanatory comments for each field.
133
+
134
+ > **Note**: You will notice a top-level field called `predictions`. In the context of this dataset, this is a misnomer because these are actually human-labeled **annotations** (ground truth). We use the key `predictions` because we borrow this schema from the project's evaluation codebase, which uses a unified structure for both ground truth and model predictions.
135
+
136
+ ```json
137
+ {
138
+ // Canonical mapping of integer IDs to class names
139
+ "label_map": {
140
+ "1": "Figure",
141
+ "2": "Table"
142
+ },
143
+
144
+ // High-level metadata about the file
145
+ "info": {
146
+ "schema_version": "1.3",
147
+ "type": "ground_truth", // Indicates these are human annotations
148
+ "created_at": "2026-05-20T13:44:29",
149
+ "run_id": "human-annotation-combined-e3432dce89",
150
+ "model": {
151
+ "name": "human annotation"
152
+ },
153
+ "coordinate_system": {
154
+ "type": "normalized_xyxy",
155
+ "range": [0.0, 1.0], // Bounding boxes are normalized between 0 and 1
156
+ "origin": "top_left"
157
+ }
158
+ },
159
+
160
+ // List of documents referenced in this file
161
+ "documents": [
162
+ {
163
+ "doc_id": "1_advocacy_note_mineaction_-_niger_eng.pdf",
164
+ "doc_name": "1_advocacy_note_mineaction_-_niger_eng.pdf",
165
+ "doc_path": "pdf_input/1_advocacy_note_mineaction_-_niger_eng.pdf"
166
+ }
167
+ ],
168
+
169
+ // Per-page container of objects; these contain the ground truth annotations
170
+ "predictions": [
171
+ {
172
+ "page_id": "1_advocacy_note_mineaction_-_niger_eng.pdf::p001",
173
+ "doc_id": "1_advocacy_note_mineaction_-_niger_eng.pdf",
174
+ "page_index": 0, // 0-indexed page number
175
+ "objects": [
176
+ {
177
+ "id": "obj_001",
178
+ "label": "Figure", // Matches a label_map entry
179
+ "bbox": [0.029, 0.177, 0.595, 0.735], // Normalized [x_min, y_min, x_max, y_max]
180
+ "score": null // Always null for ground truth
181
+ }
182
+ ]
183
+ }
184
+ ]
185
+ }
186
+ ```
187
+
188
+ ### Metadata
189
+
190
+ The metadata files follow the [**World Bank Document Metadata Schema**](https://worldbank.github.io/schema-guide/chapter05.html). See `schemas/metadata_schema.json` for the formal JSON schema definition.
191
+
192
+ All metadata files across all sources share a uniform schema (same keys at every nesting level, same types) to ensure compatibility with Apache Arrow and HuggingFace streaming.
193
+
194
+ Top-level fields:
195
+ - `type`
196
+ - `metadata_information`
197
+ - `document_description`
198
+ - `provenance`
199
+ - `tags`
200
+ - `schematype`
201
+ - `additional` - contains source-specific fields (e.g. `additional.unhcr_*` for UNHCR, `additional.wds_*` for WDS API-sourced datasets).
202
+
203
+ ## Dataset creation
204
+ The annotations were produced through human labeling using Label Studio.
205
+
206
+ ## Licensing information
207
+ unknown
208
+
209
+ ## Citation information
210
+ ```bibtex
211
+ @article{dy2026benchmarking,
212
+ title={Benchmarking Open-Source Layout Detection Models for Data Snapshot Extraction from Institutional Documents},
213
+ author={Dy, AJ Carl P. and Solatorio, Aivin V.},
214
+ journal={arXiv preprint arXiv:2606.06242},
215
+ year={2026}
216
+ }
217
+ ```