pubmed-ocr / README.md
hheiden-roots's picture
Update paper link and citation info (#2)
e9dae90 verified
---
language:
- en
license: other
size_categories:
- 1M<n<10M
task_categories:
- image-to-text
- image-text-to-text
pretty_name: PubMed-OCR
arxiv: 2601.11425
dataset_info:
features:
- name: basename
dtype: string
- name: page
dtype: int32
- name: license
dtype: string
- name: pmid
dtype: string
- name: accession_id
dtype: string
- name: article_citation
dtype: string
- name: pdf_bytes
dtype: binary
- name: ocr_json
dtype: string
configs:
- config_name: default
data_files:
- split: train
path: train-*.parquet
license_name: pubmed-ocr-multiple-cc-licenses
tags:
- biology
- medical
- ocr
- multimodal
---
# PubMed-OCR: PMC Open Access OCR Annotations
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.
**Scale (release):**
- **209.5K** articles
- **~1.5M** pages
- **~1.3B** words (OCR tokens)
This dataset is intended to support layout-aware modeling, coordinate-grounded QA, and evaluation of OCR-dependent pipelines on scientific documents.
## Dataset Details
### Dataset Description
- **Curated by:** Roots.ai
- **Point of contact:** ai-ml@roots.ai
- **Language:** English (primarily; see limitations)
- **Data unit:** **1 row = 1 PDF page** (unique by `{basename, page}`)
- **License:** See **Licensing** section (source-article licenses; per-row `license` field)
### Dataset Sources
- **Repository:** https://huggingface.co/datasets/rootsautomation/pubmed-ocr
- **Paper:** [PubMed-OCR: PMC Open Access OCR Annotations](https://huggingface.co/papers/2601.11425)
- **Source corpus:** PubMed Central Open Access (PMCOA)
## Uses
### Direct Use
PubMed-OCR is suitable for:
- Training/evaluating **OCR-aware** or **layout-aware** document models
- Testing robustness of pipelines that depend on OCR (parsing, retrieval, extraction)
- Building tasks that require **coordinate-grounded evidence** (e.g., quote-and-locate, region attribution)
- Benchmark curation for scientific PDFs (tables, formulas, captions, references)
### Out-of-Scope Use
- Do **not** treat OCR output as gold text; it contains recognition errors.
- Not intended for clinical/medical decision-making.
- Not intended for learning copyrighted content outside the applicable license terms.
- Not intended as a reading-order ground truth dataset.
## Dataset Structure
### Data Instances
Each row corresponds to a single page. Key identifiers:
- `basename`: page group identifier (article-level)
- `page`: page index within the article
`ocr_json` is a JSON string containing OCR outputs with bounding boxes in **pixel coordinates** for the rendered page image.
Example (schema sketch; fields may include additional metadata):
```json
{
"image": {"width": 1275, "height": 1650, "dpi": 150},
"text": {
"words": [{"text": "Introduction", "bbox": [74, 132, 210, 156]}],
"lines": [{"text": "Introduction", "bbox": [74, 130, 612, 160]}],
"paragraphs": [{"text": "…", "bbox": [70, 120, 1180, 420]}]
}
}
```
### Data Fields
* `basename` *(string)*: article/page group identifier.
* `page` *(int32)*: page index within the PDF/article.
* `license` *(string)*: the **source article’s license** (e.g., `cc-by-4.0`, `cc-by-nc-4.0`, …).
* `pmid` *(string)*: PubMed ID when available.
* `accession_id` *(string)*: accession identifier (e.g., PMCID or internal ID).
* `article_citation` *(string)*: a citation string for the source article.
* `pdf_bytes` *(binary)*: raw PDF bytes **when redistribution is permitted**; may be empty/null otherwise.
* `ocr_json` *(string)*: OCR output JSON (see above).
### Splits
This release is provided as a single split (`train`) because it is primarily a **corpus**.
For benchmarking, consider constructing evaluation splits that reduce leakage, e.g.:
* **Journal-level splits** (hold out entire journals)
* **Time-based splits** (hold out by publication year)
* **PMID/PMCID disjoint splits** (article-level separation)
## Dataset Creation
### Curation Rationale
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.
### Source Data
#### Data Collection and Processing
High-level pipeline:
1. Download PubMed Central Open Access PDFs (PMCOA) and filter to licenses permitting redistribution of derived artifacts.
2. Uniformly sample 209.5K documents.
3. Render each page at **150 DPI**.
4. Run **Google Cloud Vision** `document_text_detection` on page images.
5. Extract word- and paragraph-level polygons and canonicalize to axis-aligned bboxes `[x1, y1, x3, y3]`.
6. Reconstruct **line** bboxes by clustering words with similar vertical alignment (heuristic).
7. Emit one row per page with `ocr_json` (+ `pdf_bytes` where permitted).
#### Who are the source data producers?
The source texts were authored by scientific article authors and published via journals hosted in PubMed Central Open Access.
### Annotations
#### Annotation process
Annotations are machine-generated via Google Cloud Vision OCR.
* **Words / paragraphs:** provided by the OCR engine
* **Lines:** reconstructed heuristically from word boxes (see Limitations)
#### Who are the annotators?
The OCR engine is the annotator. No manual annotation was performed in this release.
#### Personal and Sensitive Information
Scientific articles can contain author names, affiliations, acknowledgements, emails, and citations. Content is drawn from publicly available PMCOA articles; no additional anonymization is applied.
## Bias, Risks, and Limitations
* **Single OCR engine:** outputs reflect Google Vision’s strengths/weaknesses and may not generalize to other OCR systems.
* **Heuristic line reconstruction:** line grouping and reading order can be imperfect, especially in multi-column layouts and around formulas/tables.
* **Axis-aligned boxes:** original OCR polygons are simplified to rectangles.
* **Domain skew:** PMCOA’s journal distribution is heavy-tailed (high-volume journals dominate).
* **Non-text regions:** this dataset does not provide gold structure for tables/figures/formulas (only what OCR emits + derived lines).
### Recommendations
* When reporting results, specify whether you use **words**, **lines**, or **paragraphs**, and whether you re-linearize text.
* For fair evaluation, prefer **journal-disjoint** or **article-disjoint** splits.
* If you need table/figure structure, pair this with a layout/table dataset (or run a layout model on top).
## Licensing
This dataset contains content derived from PMCOA articles.
* Each example inherits the **license of its source article**, recorded in the `license` field.
* Users are responsible for complying with the license terms for any subset they use.
* If `pdf_bytes` is present, it is provided only where redistribution is permitted.
## Citation
If you use PubMed-OCR, please cite:
```bibtex
@article{heidenreich2025pubmedocr,
title={PubMed-OCR: PMC Open Access OCR Annotations},
author={Heidenreich, Hunter and Getachew, Yosheb and Dinica, Olivia and Elliott, Ben},
journal={arXiv preprint arXiv:2601.11425},
year={2025}
}
```
## How to Load
```python
from datasets import load_dataset
import json
ds = load_dataset("rootsautomation/pubmed-ocr", split="train")
row = ds[0]
ocr = json.loads(row["ocr_json"])
words = ocr["text"]["words"]
```
For large-scale iteration, consider streaming:
```python
ds = load_dataset("rootsautomation/pubmed-ocr", split="train", streaming=True)
for row in ds:
ocr = json.loads(row["ocr_json"])
...
```