--- license: cc0-1.0 language: - vi task_categories: - image-to-text tags: - ocr - vietnamese - documents - public-domain - government-documents - scanned-pdf - contracts - receipts size_categories: - n<1K pretty_name: Vietnamese scanned document evaluation set (real PD + synthetic_scan) configs: - config_name: real data_files: - split: test path: real/** - config_name: formal data_files: - split: test path: formal/** - config_name: news_business data_files: - split: test path: news_business/** - config_name: conversational data_files: - split: test path: conversational/** - config_name: literary data_files: - split: test path: literary/** - config_name: receipt data_files: - split: test path: receipt/** - config_name: contract data_files: - split: test path: contract/** - config_name: form data_files: - split: test path: form/** --- # `vn-ocr-documents-eval` v0.3 107 single-page Vietnamese documents for evaluating PDF / image → DOCX OCR pipelines. Six configs covering the full register matrix (formal + business + conversational + literary) plus real PD scans and synthetic receipts. | Config | n | Source | License | |---|---:|---|---| | `real` | 9 | chinhphu.vn + hanoi.gov.vn signed scans | Public Domain (Luật SHTT VN, Điều 15) | | `formal` | 24 | UDHR-vie articles + scan artifacts | CC0 (rendered) — UDHR text is PD | | `news_business` | 24 | wiki_vi article openings + scan artifacts | CC-BY-SA 4.0 (Wikipedia VN) | | `conversational` | 24 | tatoeba_vi sentence groups + scan artifacts | CC-BY 2.0 FR (Tatoeba) | | `literary` | 23 | wikisource Truyện Kiều excerpts + scan artifacts | Public Domain | | `receipt` | 21 | 7 templates x 3 seeds (tax invoice, payment, expense voucher, transport ticket, donation, utility, medical) | CC0 1.0 | | `contract` | 20 | 5 templates x 4 seeds (labor, rental, economic, service, loan) | CC0 1.0 | | `form` | 20 | 5 templates x 4 seeds (resignation, residence cert, enrollment, leave, business registration) | CC0 1.0 | ## What's new vs v0.1 - v0.1 was 100 % PIL-rendered synthetic content. That made `convert_to_docx` look like a 0.30 % CER tool — accurate for the synthetic, misleading for real scans. - v0.2 ships **9 real public-domain Vietnamese government scans** across central + provincial domains and 7 document types (Quyết định, Công văn, Nghị quyết, Thông tư, Thông báo, Kế hoạch + the synthetic receipts). - The honest baseline number on real scans is **12.62 % whitespace-normalized CER** — 42x worse than the v0.1 synthetic baseline. That's the gap a "real document OCR" pipeline actually needs to close. ## Source diversity | Issuer | Source domain | Doc types | |---|---|---| | Thủ tướng Chính phủ | chinhphu.vn | Quyết định x 2 | | Văn phòng Chính phủ | chinhphu.vn | Công văn | | Chính phủ | chinhphu.vn | Nghị quyết | | Bộ Công Thương | chinhphu.vn | Thông tư | | Bộ Công an | chinhphu.vn | Thông tư | | UBND TP Hà Nội | hanoi.gov.vn | Quyết định, Thông báo, Kế hoạch | | (synthetic) | — | Hoá đơn, Biên lai, Phiếu chi | ## Usage ```python from datasets import load_dataset # Real PD scans (each row = one page + ground-truth text) real = load_dataset("nrl-ai/vn-ocr-documents-eval", "real", split="test") print(real[0]["text"][:120]) real[0]["image"].show() # Synthetic receipts with scan artifacts synth = load_dataset("nrl-ai/vn-ocr-documents-eval", "synthetic_scan", split="test") ``` For end-to-end PDF → DOCX evaluation, use the per-doc PDFs in `docs/.pdf` plus the flat `metadata.jsonl` (`text` field) which covers both configs. ## Reference baseline — `nom.convert.convert_to_docx` Latest in-house bench ([source](https://github.com/nrl-ai/nom-vn/blob/main/benchmarks/results/baseline_convert_documents_v2.json)), Tesseract 5 (`vie+eng` pack) via the `pdf_to_docx` OCR-fallback path: | Config | CER (whitespace-normalized) | n | |---|---:|---:| | `real` | **12.62 %** | 9 | | `synthetic_scan` | 0.43 % | 3 | | **OVERALL** | **9.57 %** | 12 | Throughput: ~0.7 docs/sec on a single CPU. CER computed on whitespace-normalized strings (NFC, runs of whitespace collapsed to single space). The 12.62 % real-config CER reflects the combined difficulty of: (a) skewed scans with stamps, (b) admin abbreviations Tesseract's vie pack doesn't handle gracefully (signature blocks, "KT.", etc.), (c) low-contrast watermarks behind body text. Per-doc CER ranges 4-22 % — `real_qd_707_ttg` is the cleanest scan (4 %), `real_hanoi_tb_453_flag` is the worst (22 %, short bold title with stamps). Run yourself: ```bash git clone https://github.com/nrl-ai/nom-vn cd nom-vn pip install -e ".[doc]" python benchmarks/data/vn_documents_ocr_v2/_generate.py python benchmarks/accuracy/bench_convert_documents_v2.py ``` ## Honesty notes - **n=12 is small.** Use for smoke + regression checks; for adoption claims expand to 50-100 docs covering more issuers and date ranges. - **Ground truth is human-verified visual transcription** — each `text` field was produced by directly reading the rendered page (not by trusting Tesseract output). Errors of judgment may remain in long numbered lists. - **Page 1 only.** Some sources are multi-page; only page 1 is in the corpus. The `sources/_full.pdf` files preserve the originals for future expansion. - **No PII**. The chinhphu.vn / hanoi.gov.vn documents name public officials in their official capacity (PM, Ministers, Phó Chủ tịch UBND) — public record. Synthetic receipts contain only fictional names. ## License - The 9 documents in `real` config: **Public Domain** under Luật Sở hữu trí tuệ Việt Nam, Điều 15 (Vietnamese government works are not subject to copyright). Source URLs in metadata. - The 3 documents in `synthetic_scan` config: **CC0 1.0 Universal** (synthetic content, no rights reserved). - This README + the `_generate.py` script: **CC0 1.0**. ## Citation ```bibtex @dataset{nguyen_vn_ocr_documents_eval_v2_2026, author = {Nguyen, Viet-Anh and {Neural Research Lab}}, title = {{vn-ocr-documents-eval v0.2: Realistic Vietnamese scanned-document evaluation set with central + provincial government documents}}, year = {2026}, url = {https://huggingface.co/datasets/nrl-ai/vn-ocr-documents-eval} } ``` Maintained as part of the [`nom-vn`](https://github.com/nrl-ai/nom-vn) project by Viet-Anh Nguyen (`vietanh@nrl.ai`) and Neural Research Lab.