Thai Government PDF OCR Test Benchmark (narawit16/thai-govern-test-ocr)
An evaluation benchmark and training corpus of Thai government documents designed for OCR, layout analysis, and VLM document-parsing:
default: Broad cross-agency Thai open government PDFs from data.go.th (15 domain groups, 111 agencies, 200 DPI).
saraban_6types: Curated 6 official Thai Saraban correspondence types (ระเบียบสำนักนายกรัฐมนตรีว่าด้วยงานสารบรรณ) from dla.go.th & data.go.th (300 DPI, PDPA-screened, with human-verified Golden Set Ground Truth).
google_docs: Web-crawled Thai government & local administration document images.
dla_bulk: High-coverage multi-portal collection from www.dla.go.th & sll.dla.go.th (official letters, local laws, articles, legal opinions, 200 DPI, PDPA-screened).
intern_soda_krut: Thai government documents containing the official Garuda emblem (ตราครุฑ), contributed by Intern-SODA (train_kruthdetect/DATA/has_krut).
Config 1: saraban_6types (6 Official Saraban Document Types)
- Total Pages (
test split): 419 pages from 278 PDFs (52 organizations)
- Resolution: 300 DPI (RGB PNG)
- Stratification: 77.33% Scanned (
scanned + scanned_ocr) / 22.67% Complex Digital
- PDPA Screening: Pre-filtered HR/welfare titles + 13-digit Arabic & Thai numeral ID checksum check on both embedded text and RapidOCR scanned text (
ocr_pii_rejected=0).
Golden Set Ground Truth (is_golden_set == True)
- Verified GT Pages (
gt_status == "human_verified"): 114 pages (flagged: 3)
- GT Format: Full-page Markdown (GFM tables + HTML
<table> for merged cells) in ground_truth_text, plus KIE Header JSON (doc_no, doc_date, subject) in gt_kie_json.
- Transcription Rules:
- Exact printed numerals preserved verbatim (
๑–๙ vs 0–9).
- Printed body/headers + clearly readable rubber stamps (
ด่วนที่สุด, agency receipt stamps) transcribed; illegible wet signatures tagged [SIGNATURE]; handwritten margin notes excluded.
Baseline Draft Evaluation (on human_verified Golden Set)
(Note: gemini-4-hydrogen served as the primary UI pre-fill draft, so its baseline CER reflects draft-assisted edits.)
Overall Leaderboard
| Model |
N |
Strict CER (↓) |
Norm CER (↓) |
Thai WER (↓) |
Table Cell F1 (↑) |
Table TEDS (↑) |
KIE Exact (↑) |
KIE Norm F1 (↑) |
gemini-4-hydrogen |
114 |
3.53% |
3.53% |
3.60% |
96.88% |
96.88% |
44.15% |
45.80% |
gemma4-26b |
114 |
26.60% |
22.55% |
30.31% |
65.02% |
67.24% |
10.38% |
46.70% |
Breakdown by saraban_type (Norm CER ↓)
Breakdown by saraban_type
saraban_type |
Pages |
external_letter |
70 |
internal_memo |
70 |
stamped_letter |
70 |
order_regulation |
70 |
public_relations |
70 |
official_record |
69 |
Breakdown by page_type & page_role
page_type |
Pages |
scanned |
322 (76.8%) |
digital |
95 (22.7%) |
scanned_ocr |
2 (0.5%) |
page_role |
Pages |
first_page_header |
272 |
signature_page |
100 |
body_table |
47 |
Config 2: default (General data.go.th Multi-Domain Benchmark)
- Total Pages (
test split): 536 pages from 193 PDFs (111 agencies)
- Resolution: 200 DPI (RGB PNG)
- Stratification: 75.0% Scanned / 25.0% Complex Digital
Page Type Breakdown
page_type |
Pages |
scanned |
260 (48.5%) |
scanned_ocr |
142 (26.5%) |
digital |
134 (25.0%) |
Domain Group Breakdown (group)
Group (data.go.th) |
Pages |
travel |
51 |
map |
49 |
politic |
46 |
social |
45 |
law |
43 |
economy |
38 |
research |
37 |
public-health |
36 |
logistic |
36 |
agriculture |
36 |
energy |
34 |
government |
34 |
doi |
26 |
education |
17 |
culture |
8 |
Config 3: google_docs (Web-Crawled Thai Government & Local Admin Documents)
- Total Images (
test split): 108 images (EXIF-normalized RGB PNG, deduplicated, PDPA-screened)
- Max Edge: 3508 px
Breakdown by Search Keyword
keyword |
Images |
เอกสารจัดซื้อจัดจ้าง ราชการ |
15 |
บันทึกข้อความ อบต |
13 |
ประกาศ อบต |
11 |
คำสั่ง อบจ |
10 |
หนังสือราชการ เทศบาล |
8 |
หนังสือราชการ โรงเรียน |
8 |
ประกาศผู้ชนะการเสนอราคา อบต |
7 |
รายงานการประชุม อบต |
7 |
เอกสารราชการ อบจ |
6 |
เอกสารราชการ อบต |
6 |
ประกาศ อบจ |
5 |
หนังสือราชการ อำเภอ |
5 |
บันทึกข้อความ โรงเรียน |
4 |
คำสั่ง อบต |
3 |
Config 4: dla_bulk (DLA Multi-Portal Corpus from dla.go.th & sll.dla.go.th)
- Total Pages (
train split): 1,848 pages from 917 PDFs
- Resolution: 200 DPI (RGB PNG)
- Stratification: 72.0% Scanned (
scanned + scanned_ocr) / 28.0% Digital
- PDPA Screening: Excluded 196 PII-flagged pages and 30 blank/other pages.
Breakdown by Portal (source)
source |
Pages |
official_doc |
1,383 |
sll |
315 |
articles |
102 |
legal_item |
28 |
index_direct |
20 |
Breakdown by page_type
page_type |
Pages |
scanned |
1,249 (67.6%) |
digital |
517 (28.0%) |
scanned_ocr |
82 (4.4%) |
Config 5: intern_soda_krut (Garuda-Stamped Thai Official Documents)
- Total Images (
train split): 446 images (EXIF-normalized RGB PNG, deduplicated, has_krut=True)
- Max Edge: 3508 px
- Source & Credit: Intern-SODA (
train_kruthdetect/DATA/has_krut) — Thai government documents featuring the official Garuda emblem (ตราครุฑ).
Acknowledgments & Credits
- Intern-SODA: Contributed the
intern_soda_krut subset (Garuda-stamped Thai official document pages from train_kruthdetect/DATA/has_krut).
Usage
from datasets import load_dataset
saraban = load_dataset("narawit16/thai-govern-test-ocr", "saraban_6types", split="test")
scanned_letters = saraban.filter(
lambda x: x["saraban_type"] == "external_letter" and x["page_type"] == "scanned"
)
general = load_dataset("narawit16/thai-govern-test-ocr", "default", split="test")
Note on KIE Evaluation (meta_doc_no, meta_doc_date, meta_subject):
Web metadata often uses Arabic digits (e.g., มท 0808.2/ว 1234), whereas printed/stamped paper documents frequently use Thai numerals (มท ๐๘๐๘.๒/ว ๑๒๓๔). Normalize Thai digits ๐–๙ → 0–9 before comparing extracted header fields against meta_* columns.