hheiden-roots commited on
Commit
a9515c1
·
verified ·
1 Parent(s): 540f3b0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +185 -3
README.md CHANGED
@@ -22,7 +22,8 @@ configs:
22
  data_files:
23
  - split: train
24
  path: train-*.parquet
25
- license: cc-by-nc-4.0
 
26
  task_categories:
27
  - image-to-text
28
  - image-text-to-text
@@ -38,6 +39,187 @@ size_categories:
38
  - 1M<n<10M
39
  ---
40
 
41
- # pubmed-ocr
42
 
43
- Processed output from PubMed OCR pipeline (CC-BY-NC).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  data_files:
23
  - split: train
24
  path: train-*.parquet
25
+ license: other
26
+ license_name: pubmed-ocr-multiple-cc-licenses
27
  task_categories:
28
  - image-to-text
29
  - image-text-to-text
 
39
  - 1M<n<10M
40
  ---
41
 
42
+ # PubMed-OCR: PMC Open Access OCR Annotations
43
 
44
+ PubMed-OCR is an OCR-centric corpus of scientific articles derived from PubMed Central Open Access PDFs. Each **page** is rendered to an image and annotated with **Google Cloud Vision OCR**, released in a compact JSON schema with **word-, line-, and paragraph-level** bounding boxes.
45
+
46
+ **Scale (release):**
47
+ - **209.5K** articles
48
+ - **~1.5M** pages
49
+ - **~1.3B** words (OCR tokens)
50
+
51
+ This dataset is intended to support layout-aware modeling, coordinate-grounded QA, and evaluation of OCR-dependent pipelines on scientific documents.
52
+
53
+ ## Dataset Details
54
+
55
+ ### Dataset Description
56
+
57
+ - **Curated by:** Roots.ai
58
+ - **Point of contact:** ai-ml@roots.ai
59
+ - **Language:** English (primarily; see limitations)
60
+ - **Data unit:** **1 row = 1 PDF page** (unique by `{basename, page}`)
61
+ - **License:** See **Licensing** section (source-article licenses; per-row `license` field)
62
+
63
+ ### Dataset Sources
64
+
65
+ - **Repository:** https://huggingface.co/datasets/rootsautomation/pubmed-ocr
66
+ - **Paper:** Coming Soon
67
+ - **Source corpus:** PubMed Central Open Access (PMCOA)
68
+
69
+ ## Uses
70
+
71
+ ### Direct Use
72
+
73
+ PubMed-OCR is suitable for:
74
+ - Training/evaluating **OCR-aware** or **layout-aware** document models
75
+ - Testing robustness of pipelines that depend on OCR (parsing, retrieval, extraction)
76
+ - Building tasks that require **coordinate-grounded evidence** (e.g., quote-and-locate, region attribution)
77
+ - Benchmark curation for scientific PDFs (tables, formulas, captions, references)
78
+
79
+ ### Out-of-Scope Use
80
+
81
+ - Do **not** treat OCR output as gold text; it contains recognition errors.
82
+ - Not intended for clinical/medical decision-making.
83
+ - Not intended for learning copyrighted content outside the applicable license terms.
84
+ - Not intended as a reading-order ground truth dataset.
85
+
86
+ ## Dataset Structure
87
+
88
+ ### Data Instances
89
+
90
+ Each row corresponds to a single page. Key identifiers:
91
+ - `basename`: page group identifier (article-level)
92
+ - `page`: page index within the article
93
+
94
+ `ocr_json` is a JSON string containing OCR outputs with bounding boxes in **pixel coordinates** for the rendered page image.
95
+
96
+ Example (schema sketch; fields may include additional metadata):
97
+
98
+ ```json
99
+ {
100
+ "image": {"width": 1275, "height": 1650, "dpi": 150},
101
+ "text": {
102
+ "words": [{"text": "Introduction", "bbox": [74, 132, 210, 156]}],
103
+ "lines": [{"text": "Introduction", "bbox": [74, 130, 612, 160]}],
104
+ "paragraphs": [{"text": "…", "bbox": [70, 120, 1180, 420]}]
105
+ }
106
+ }
107
+ ```
108
+
109
+ ### Data Fields
110
+
111
+ * `basename` *(string)*: article/page group identifier.
112
+ * `page` *(int32)*: page index within the PDF/article.
113
+ * `license` *(string)*: the **source article’s license** (e.g., `cc-by-4.0`, `cc-by-nc-4.0`, …).
114
+ * `pmid` *(string)*: PubMed ID when available.
115
+ * `accession_id` *(string)*: accession identifier (e.g., PMCID or internal ID).
116
+ * `article_citation` *(string)*: a citation string for the source article.
117
+ * `pdf_bytes` *(binary)*: raw PDF bytes **when redistribution is permitted**; may be empty/null otherwise.
118
+ * `ocr_json` *(string)*: OCR output JSON (see above).
119
+
120
+ ### Splits
121
+
122
+ This release is provided as a single split (`train`) because it is primarily a **corpus**.
123
+ For benchmarking, consider constructing evaluation splits that reduce leakage, e.g.:
124
+
125
+ * **Journal-level splits** (hold out entire journals)
126
+ * **Time-based splits** (hold out by publication year)
127
+ * **PMID/PMCID disjoint splits** (article-level separation)
128
+
129
+ ## Dataset Creation
130
+
131
+ ### Curation Rationale
132
+
133
+ Scientific PDFs are dense (formulas, tables, multi-column layouts). Many PMCOA datasets rely on PDF/XML alignment, which can miss scanned pages or inherit parser noise. PubMed-OCR provides OCR-native supervision directly from rendered page images, enabling OCR-dependent evaluation and layout-aware learning without PDF/XML alignment.
134
+
135
+ ### Source Data
136
+
137
+ #### Data Collection and Processing
138
+
139
+ High-level pipeline:
140
+
141
+ 1. Download PubMed Central Open Access PDFs (PMCOA) and filter to licenses permitting redistribution of derived artifacts.
142
+ 2. Uniformly sample 209.5K documents.
143
+ 3. Render each page at **150 DPI**.
144
+ 4. Run **Google Cloud Vision** `document_text_detection` on page images.
145
+ 5. Extract word- and paragraph-level polygons and canonicalize to axis-aligned bboxes `[x1, y1, x3, y3]`.
146
+ 6. Reconstruct **line** bboxes by clustering words with similar vertical alignment (heuristic).
147
+ 7. Emit one row per page with `ocr_json` (+ `pdf_bytes` where permitted).
148
+
149
+ #### Who are the source data producers?
150
+
151
+ The source texts were authored by scientific article authors and published via journals hosted in PubMed Central Open Access.
152
+
153
+ ### Annotations
154
+
155
+ #### Annotation process
156
+
157
+ Annotations are machine-generated via Google Cloud Vision OCR.
158
+
159
+ * **Words / paragraphs:** provided by the OCR engine
160
+ * **Lines:** reconstructed heuristically from word boxes (see Limitations)
161
+
162
+ #### Who are the annotators?
163
+
164
+ The OCR engine is the annotator. No manual annotation was performed in this release.
165
+
166
+ #### Personal and Sensitive Information
167
+
168
+ Scientific articles can contain author names, affiliations, acknowledgements, emails, and citations. Content is drawn from publicly available PMCOA articles; no additional anonymization is applied.
169
+
170
+ ## Bias, Risks, and Limitations
171
+
172
+ * **Single OCR engine:** outputs reflect Google Vision’s strengths/weaknesses and may not generalize to other OCR systems.
173
+ * **Heuristic line reconstruction:** line grouping and reading order can be imperfect, especially in multi-column layouts and around formulas/tables.
174
+ * **Axis-aligned boxes:** original OCR polygons are simplified to rectangles.
175
+ * **Domain skew:** PMCOA’s journal distribution is heavy-tailed (high-volume journals dominate).
176
+ * **Non-text regions:** this dataset does not provide gold structure for tables/figures/formulas (only what OCR emits + derived lines).
177
+
178
+ ### Recommendations
179
+
180
+ * When reporting results, specify whether you use **words**, **lines**, or **paragraphs**, and whether you re-linearize text.
181
+ * For fair evaluation, prefer **journal-disjoint** or **article-disjoint** splits.
182
+ * If you need table/figure structure, pair this with a layout/table dataset (or run a layout model on top).
183
+
184
+ ## Licensing
185
+
186
+ This dataset contains content derived from PMCOA articles.
187
+
188
+ * Each example inherits the **license of its source article**, recorded in the `license` field.
189
+ * Users are responsible for complying with the license terms for any subset they use.
190
+ * If `pdf_bytes` is present, it is provided only where redistribution is permitted.
191
+
192
+ ## Citation
193
+
194
+ If you use PubMed-OCR, please cite:
195
+
196
+ ```bibtex
197
+ @article{heidenreich2025pubmedocr,
198
+ title={PubMed-OCR: PMC Open Access OCR Annotations},
199
+ author={Heidenreich, Hunter and Getachew, Yosheb and Dinica, Olivia and Elliott, Ben},
200
+ journal={arXiv preprint arXiv:XXXX.XXXXX},
201
+ year={2025}
202
+ }
203
+ ```
204
+
205
+ ## How to Load
206
+
207
+ ```python
208
+ from datasets import load_dataset
209
+ import json
210
+
211
+ ds = load_dataset("rootsautomation/pubmed-ocr", split="train")
212
+
213
+ row = ds[0]
214
+ ocr = json.loads(row["ocr_json"])
215
+ words = ocr["text"]["words"]
216
+ ```
217
+
218
+ For large-scale iteration, consider streaming:
219
+
220
+ ```python
221
+ ds = load_dataset("rootsautomation/pubmed-ocr", split="train", streaming=True)
222
+ for row in ds:
223
+ ocr = json.loads(row["ocr_json"])
224
+ ...
225
+ ```