Request Access to This Dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

This dataset contains a subset of PDF pages, selected by cycling through books (one page per book in turn) to maximize coverage, sourced from the Ministry of Education, Youth and Sport (MoEYS) Sala Digital portal (sala.moeys.gov.kh) and 5000-Years (5000-years.org), alongside Gemini-generated transcripts. The dataset creators claim no ownership or copyright over the original PDF files; all rights to the source materials remain with MoEYS, 5000-years.org, and their respective authors or publishers. The CC BY-NC 4.0 license applies strictly to our transcripts, annotations, and dataset compilation. This dataset is for non-commercial research and educational use only and is not affiliated with or endorsed by MoEYS or 5000-years.org.

Log in or Sign Up to review the conditions and access this dataset content.

KhmerEduDoc

KhmerEduDoc is a 65,000-page Khmer educational document OCR dataset. It is composed of randomly sampled, non-contiguous single PDF pages paired with AI-generated text transcripts. Source documents were collected from publicly accessible educational and cultural portals—specifically Cambodia's Ministry of Education, Youth and Sport (MoEYS, sala.moeys.gov.kh) and 5000-Years (5000-years.org). The transcriptions were generated automatically by a frozen teacher model, Gemini 3.7 Flash (gemini-3.7-flash, run between 14 and 23 August 2026). The dataset includes two human-verified evaluation sets. This dataset supports academic research in Khmer Document AI, Optical Character Recognition (OCR), and low-resource language modeling.

The dataset is used to fine-tune and evaluate two OCR vision-language models with LoRA:

Splits

Split Pages Labels Description
train 61,750 Gemini (teacher) Training pages
validation 3,250 Gemini (teacher) Validation pages
test_setA 60 Human-verified Educational pages: 50 text-only, 10 with LaTeX
test_setB 100 Human-verified Older documents (publication dates 1952 to 2003)

train and validation together form the 65,000-page release, chosen from 4,407 books (342,156 pages) by cycling through books to maximize book coverage. test_setA and test_setB are disjoint from the release.

Data fields

Column Type Description
image Image Page image
text string Transcription in reading order. Tables are HTML, math is LaTeX (\[ \] block, \( \) inline)
book_id string Source book ID, parsed from the filename (may be empty for some Set B rows)
page int Page number in the book (may be empty for some Set B rows)
label_source string gemini (teacher label) or human (human-verified)
content_type string Only in test_setA: text_only or text_with_latex. Empty in other splits

Example row:

{"image": "<PIL image>", "text": "មនុស្សមិនល្អគ្រប់ដប់ទេ\nរៀនមើលចំណុចល្អគេឱ្យបានច្រើន។", "book_id": "66e7b04c3dbbe7c3c8ba6d1c", "page": 77, "label_source": "human", "content_type": "text_only"}

Usage

from datasets import load_dataset

ds = load_dataset("CADT-IDRI/KhmerEduDoc")
print(ds)
print(ds["test_setA"][0]["text"])

Converting to fine-tuning formats

The dataset stores plain image and text columns. To fine-tune the OCR models, convert each row into the chat format that model expects. Each line below is one training example (<path> is the saved image path).

DeepSeek-OCR-2 (prompt <image>\nFree OCR.):

{"messages": [{"role": "<|User|>", "content": "<image>\nFree OCR.", "images": ["<path>"]}, {"role": "<|Assistant|>", "content": "<text>"}]}

PaddleOCR-VL (prompt OCR:):

{"images": ["<path>"], "messages": [{"role": "user", "content": [{"type": "text", "text": "OCR:"}, {"type": "image", "image": "<path>"}]}, {"role": "assistant", "content": [{"type": "text", "text": "<text>"}]}]}

Conversion script:

import json, os
from datasets import load_dataset

ds = load_dataset("CADT-IDRI/KhmerEduDoc")

def export(split, fmt, out_dir):
    os.makedirs(f"{out_dir}/images/{split}", exist_ok=True)
    with open(f"{out_dir}/{split}.jsonl", "w", encoding="utf-8") as f:
        for i, row in enumerate(ds[split]):
            path = f"{out_dir}/images/{split}/{i}.png"
            row["image"].save(path)
            if fmt == "deepseek":
                ex = {"messages": [
                    {"role": "<|User|>", "content": "<image>\nFree OCR.", "images": [path]},
                    {"role": "<|Assistant|>", "content": row["text"]}]}
            else:  # paddle
                ex = {"images": [path], "messages": [
                    {"role": "user", "content": [
                        {"type": "text", "text": "OCR:"},
                        {"type": "image", "image": path}]},
                    {"role": "assistant", "content": [
                        {"type": "text", "text": row["text"]}]}]}
            f.write(json.dumps(ex, ensure_ascii=False) + "\n")

export("train", "deepseek", "deepseek_data")
export("train", "paddle", "paddle_data")

Transcription format

The teacher was prompted to output plain reading-order text. Tables are serialized as HTML. Math is serialized as LaTeX. Khmer diacritics, subscripts and English text are kept as they appear, with no translation. Decorative elements, figures, tables of contents with dot leaders, and author/committee lists are omitted, so some pages may have empty or short transcriptions.

Evaluation sets

  • Set A (60 images): pages from the 4,407-book corpus, disjoint from the release. 50 contain Khmer text only and 10 also contain mathematical content. The teacher draft was corrected at the character level by one native Khmer-speaking annotator.
  • Set B (100 images): older documents from the public collection 5000-years.org. In the books inspected, publication dates range from 1952 to 2003. The teacher draft was corrected by one native Khmer-speaking annotator.

Fine-tuned results (CER, %):

Model Set A (text) Set A (LaTeX) Set B
DeepSeek-OCR-2 (LoRA) 16.39 45.02 37.97
PaddleOCR-VL (LoRA) 10.02 10.78 24.41

Limitations

  • All training labels come from a single teacher model (Gemini 3.7 Flash), so its systematic errors are inherited. The released training and validation labels were not audited against the images at scale.
  • The evaluation references were corrected from teacher drafts by a single annotator. No inter-annotator agreement is available, and anchoring to the teacher is possible.
  • The evaluation sets are small (60 and 100 images), and the 10-image LaTeX subset is indicative only.

Citation

If you use this dataset, please cite this paper:

@misc{song2026khmeredudoc,
  author       = {Song, Kimleangchhay and Chuor, Porchourng and Heang, Sopagna and Nom, Vannkinh and Ly, Rottana},
  title        = {{KhmerEduDoc}: A Multimodal Document {OCR} Dataset for Low-Resource {Khmer} in the Wild},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/datasets/CADT-IDRI/KhmerEduDoc}},
}
Downloads last month
232

Models trained or fine-tuned on CADT-IDRI/KhmerEduDoc