emelryan's picture
Remove obsolete unassigned-license text and link the main Parse recipe docs
9d842c7 verified
|
Raw History Blame Contribute Delete
3.16 kB
---
license: cc-by-4.0
pretty_name: OCR Synthetic Multilingual v2
task_categories:
- image-to-text
annotations_creators:
- machine-generated
size_categories:
- 1M<n<10M
tags:
- image
- text
- ocr
- document-parsing
- synthetic
- nemotron-3.5-parse
models:
- nvidia/Nemotron-3.5-Parse
---
# OCR Synthetic Multilingual v2
Synthetic document pages for multilingual OCR and structured document parsing, covering 28 scripts and varied fonts, page layouts, and text directions. Annotations include text, semantic content classes, and bounding boxes.
**7,907,809 image/annotation pairs** · **12,686 WebDataset tar shards** · **training split**
This dataset was used to train [Nemotron 3.5 Parse](https://huggingface.co/nvidia/Nemotron-3.5-Parse). It supports training and adapting models for structured document understanding.
It combines the multilingual document collections used in Parse training under one annotation interface.
## How it was created
Pages were rendered from sampled corpus text with varied fonts, layouts and text directions, while recording text and geometry. See [GENERATION.md](GENERATION.md) for the process.
## Languages covered
The inventory lists **149 language/script entries across 28 scripts**. [View every covered language and script](LANGUAGES.md), or use the machine-readable [LANGUAGES.json](LANGUAGES.json).
## Format
Each record pairs an image with JSON annotations containing `block_boxes`, `block_classes`, and `block_text`. Boxes use pixel coordinates, and the arrays align by block. See [FORMAT.md](FORMAT.md) and [an example annotation](example.annotation.json) for the target representation.
## Use the data
Install `huggingface_hub`, `fsspec`, and `pillow`. The dataset is public; authentication is not required to read it.
```python
import io
import json
import runpy
from PIL import Image
from huggingface_hub import HfFileSystem, hf_hub_download
repo = "nvidia/OCR-Synthetic-Multilingual-v2"
manifest = hf_hub_download(repo, "SHARDS.jsonl", repo_type="dataset")
with open(manifest) as f:
shard = json.loads(next(f))["path"]
reader = hf_hub_download(repo, "reader.py", repo_type="dataset")
iter_records = runpy.run_path(reader)["iter_records"]
# Stream one shard; no need to download the entire dataset.
fs = HfFileSystem()
with fs.open(f"datasets/{repo}/{shard}", "rb", block_size=1024 * 1024) as stream:
records = iter_records(stream)
try:
key, parts = next(records)
finally:
records.close()
annotation = parts["json"]
image_bytes = next(parts[ext] for ext in ("png", "jpg", "jpeg") if ext in parts)
image = Image.open(io.BytesIO(image_bytes))
print(key, image.size, annotation["block_classes"])
```
Use the remaining entries in `SHARDS.jsonl` to iterate over more shards or partition work across workers. The manifest also provides record counts, byte sizes, and SHA-256 checksums. The bundled reader accepts a local tar path as well as an open binary stream.
For model adaptation, see the [Parse SFT/RLVR fine-tuning recipe](https://github.com/NVIDIA-NeMo/Nemotron/blob/main/docs/nemotron/parse/index.md).
## Terms
Upstream text and asset terms still apply.