Datasets:
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -13,18 +13,16 @@ size_categories:
|
|
| 13 |
- n<1K
|
| 14 |
---
|
| 15 |
|
| 16 |
-
# OCR Benchmark —
|
| 17 |
|
| 18 |
-
93
|
| 19 |
[ocr-benchmark](https://github.com/ilsilfverskiold/ocr-benchmark) harness.
|
| 20 |
-
|
| 21 |
-
|
| 22 |
|
| 23 |
-
##
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
Each row is one document:
|
| 28 |
|
| 29 |
| Column | Type | Description |
|
| 30 |
|---|---|---|
|
|
@@ -38,20 +36,9 @@ Each row is one document:
|
|
| 38 |
| `markdown_gt` | string | Ground-truth markdown (null if unavailable) |
|
| 39 |
| `geometry_gt` | string | Bounding-box ground truth as serialized JSON (null if unavailable) |
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
and are used by the benchmark harness for report generation and judge caching.
|
| 45 |
-
|
| 46 |
-
- `results/runs/` — JSONL result records
|
| 47 |
-
- `results/ocr_outputs/` — Raw OCR output per (engine, document, pass)
|
| 48 |
-
- `results/schema_judge_cache/` — Cached LLM judge verdicts (schema/key_value legs)
|
| 49 |
-
- `results/table_judge_cache/` — Cached LLM judge verdicts (tables leg)
|
| 50 |
-
- `results/markdown_judge_cache/` — Cached LLM judge verdicts (markdown leg)
|
| 51 |
-
- `results/judge_checklists/` — Document judge checklists (silver-GT docs)
|
| 52 |
-
- `documents/manifest.json` — Corpus manifest with source dataset provenance
|
| 53 |
-
- `documents/gt_limitations.json` — Known ground-truth limitations
|
| 54 |
-
- `documents/gt_provenance.json` — Per-document GT provenance audit trail
|
| 55 |
|
| 56 |
## Document types
|
| 57 |
|
|
@@ -78,40 +65,50 @@ deterministically (fixed row indices), not cherry-picked by content.
|
|
| 78 |
| [RVL-CDIP](https://huggingface.co/datasets/nielsr/rvl_cdip_10_examples_per_class) (Harley et al.) | 18 | Research use | Silver — Tesseract at build time; judge-only evaluation |
|
| 79 |
|
| 80 |
FUNSD, IAM, and RVL-CDIP (30 of 93 docs) carry research-use or non-commercial
|
| 81 |
-
restrictions.
|
| 82 |
-
|
|
|
|
| 83 |
|
| 84 |
## Ground-truth provenance
|
| 85 |
|
| 86 |
- **Human (75 docs)** — source dataset annotations
|
| 87 |
- **Model-verified (8 docs)** — model-transcribed, cross-checked against 14-engine consensus
|
| 88 |
-
- **Silver (11 docs)** — machine-generated (Tesseract);
|
| 89 |
-
- No GT anywhere is LLM-generated without verification
|
| 90 |
|
| 91 |
-
|
|
|
|
|
|
|
| 92 |
|
| 93 |
## Usage
|
| 94 |
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
```bash
|
| 98 |
git clone https://github.com/ilsilfverskiold/ocr-benchmark
|
| 99 |
cd ocr-benchmark
|
| 100 |
pip install -r requirements.txt
|
| 101 |
-
python scripts/download_data.py
|
| 102 |
-
python run_benchmark.py --
|
| 103 |
```
|
| 104 |
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
```python
|
| 108 |
-
from huggingface_hub import snapshot_download
|
| 109 |
-
snapshot_download("ilsilfverskiold/ocr-benchmark", repo_type="dataset",
|
| 110 |
-
allow_patterns="results/**", local_dir=".")
|
| 111 |
-
```
|
| 112 |
|
| 113 |
## License
|
| 114 |
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
of the 93 documents.
|
|
|
|
| 13 |
- n<1K
|
| 14 |
---
|
| 15 |
|
| 16 |
+
# OCR Benchmark — Documents
|
| 17 |
|
| 18 |
+
The 93 document images and ground truth used by the
|
| 19 |
[ocr-benchmark](https://github.com/ilsilfverskiold/ocr-benchmark) harness.
|
| 20 |
+
The benchmark code, the reference run results, and the full methodology live
|
| 21 |
+
in the GitHub repo — this dataset is the document corpus only.
|
| 22 |
|
| 23 |
+
## Structure
|
| 24 |
|
| 25 |
+
One `train` split, 93 rows, one row per document:
|
|
|
|
|
|
|
| 26 |
|
| 27 |
| Column | Type | Description |
|
| 28 |
|---|---|---|
|
|
|
|
| 36 |
| `markdown_gt` | string | Ground-truth markdown (null if unavailable) |
|
| 37 |
| `geometry_gt` | string | Bounding-box ground truth as serialized JSON (null if unavailable) |
|
| 38 |
|
| 39 |
+
JSON columns are stored as strings because their internal structure varies per
|
| 40 |
+
document type (a tax form's schema is not a receipt's schema). Parse with
|
| 41 |
+
`json.loads()`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
## Document types
|
| 44 |
|
|
|
|
| 65 |
| [RVL-CDIP](https://huggingface.co/datasets/nielsr/rvl_cdip_10_examples_per_class) (Harley et al.) | 18 | Research use | Silver — Tesseract at build time; judge-only evaluation |
|
| 66 |
|
| 67 |
FUNSD, IAM, and RVL-CDIP (30 of 93 docs) carry research-use or non-commercial
|
| 68 |
+
restrictions. This dataset redistributes small excerpts solely for reproducible
|
| 69 |
+
research benchmarking, with full attribution. If you are a rights holder and
|
| 70 |
+
want a document removed, open an issue — it will be removed promptly.
|
| 71 |
|
| 72 |
## Ground-truth provenance
|
| 73 |
|
| 74 |
- **Human (75 docs)** — source dataset annotations
|
| 75 |
- **Model-verified (8 docs)** — model-transcribed, cross-checked against 14-engine consensus
|
| 76 |
+
- **Silver (11 docs)** — machine-generated (Tesseract); scored by LLM judge only, never by text metrics
|
|
|
|
| 77 |
|
| 78 |
+
Per-document provenance, known limitations, and the full audit trail are in the
|
| 79 |
+
[GitHub repo](https://github.com/ilsilfverskiold/ocr-benchmark) under
|
| 80 |
+
`documents/` — and every benchmark run prints them before any score.
|
| 81 |
|
| 82 |
## Usage
|
| 83 |
|
| 84 |
+
Load directly:
|
| 85 |
+
|
| 86 |
+
```python
|
| 87 |
+
from datasets import load_dataset
|
| 88 |
+
import json
|
| 89 |
+
|
| 90 |
+
ds = load_dataset("ilsilfverskiold/ocr-benchmark", split="train")
|
| 91 |
+
row = ds[0]
|
| 92 |
+
row["image"] # PIL image
|
| 93 |
+
gt = json.loads(row["structured_gt"]) # json_schema + true_json
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
Or use it through the benchmark harness, which rebuilds the on-disk corpus
|
| 97 |
+
layout and can rerun any engine against these documents:
|
| 98 |
|
| 99 |
```bash
|
| 100 |
git clone https://github.com/ilsilfverskiold/ocr-benchmark
|
| 101 |
cd ocr-benchmark
|
| 102 |
pip install -r requirements.txt
|
| 103 |
+
python scripts/download_data.py # fetches this dataset
|
| 104 |
+
python run_benchmark.py --engines tesseract,docling --tiers easy --skip-judge
|
| 105 |
```
|
| 106 |
|
| 107 |
+
The reference benchmark results (14 engines × 93 documents × 7 legs) ship with
|
| 108 |
+
the GitHub repo — you only need this dataset if you want to rerun engines.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
## License
|
| 111 |
|
| 112 |
+
The images are excerpts from third-party datasets and keep their original
|
| 113 |
+
licenses — see the source table above. The permissive subset (MIT / CC-BY-4.0)
|
| 114 |
+
covers 57 of the 93 documents.
|