synth-ocr-augmented / README.md
lubna888's picture
Add dataset card
9e1d09b verified
|
Raw History Blame Contribute Delete
1.76 kB
---
configs:
- config_name: default
data_files:
- split: train
path: data/robust/*.parquet
language:
- ar
- en
- zh
task_categories:
- image-to-text
tags:
- ocr
- synthetic
- document-understanding
- augmentation
size_categories:
- 10K<n<100K
---
# Synthetic OCR — robust (augmented) pages
30,000 synthetic document pages (Arabic, English, Chinese) rendered from HTML layouts with the
`html2md` pipeline (str-project), then augmented to look like real-world captures.
Same schema as [FaisalHejary/synth_OCR](https://huggingface.co/datasets/FaisalHejary/synth_OCR),
so the two can be merged with `concatenate_datasets`.
## Columns
- `image`: the page (PNG).
- `json`: the full annotation as a JSON string: `page_information`, `word_bboxes`, `line_bboxes`,
`para_bboxes`, `relation_graph`, `element_bboxes`. Every box has `bbox` and `quad`.
## Augmentation
Every page is augmented; `page_information` records exactly what was applied.
- Page mix: ~40% clean, ~30% scanned, ~30% photographed (wood-table backgrounds, CC0 textures).
- Augraphy pixel effects (BadPhotoCopy, BleedThrough, Brightness, InkBleed, Letterpress, ShadowCast, ...)
and spatial effects (BookBinding, Folding, Geometric, PageBorder; boxes moved with the page).
- Custom effects: depth of field, screen photo, dark mode, stroke thin/bold, thermal fade.
- Low resolution on ~20% of pages.
- Every page passed `html2md-verify` and a final legibility check (unreadable pages were removed and regenerated).
## Load
```python
from datasets import load_dataset
import json
ds = load_dataset("lubna888/synth-ocr-augmented", split="train")
row = ds[0]
ann = json.loads(row["json"])
```
Note: page ids are unique within this dataset, but not across datasets after merging.