About the data
Where every term came from, how it was made, and how often it is wrong
6,702 entries of official Cambodian government terminology, from 22 published documents that existed only as scanned paper. This page is the full account: the sources, the pipeline that turned them into data, the NLP methods behind each step, the data statement, the measured error rate, the defects we know about, and what you may do with it.
- entries
- 6,702
- source documents
- 22
- Khmer headwords wrong in the checked sample
- 20.1%
- English glosses wrong
- 0.0%
Build 0e11fa6c1df3 ·
built 2026-09-15 · dataset version 1.1.0 ·
DOI 10.5281/zenodo.22761423
1 The pipeline
Nothing below runs when you use the site. It runs once per build; the site loads the finished file.
-
Collect the source documents
Terminology bulletins, glossaries and lexicons published by the National Council of Khmer Language, the Royal Academy of Cambodia, the Council of Ministers, the Ministry of Post and Telecommunications and the Royal Government. Each PDF's SHA-256 is recorded, so any entry can be traced to the exact file that was read. Seven were recovered from Wayback Machine captures of the NCKL's previous website, because the council's own download links are dead.
sources.json · candidates.json · scripts/verify_sources.py
-
Read every page with OCR
Each page is rendered to an image and read by Google Cloud Vision. Text layers inside the PDFs are not trusted: several use legacy Khmer fonts whose characters map to the wrong Unicode.
scripts/extract_*.py · OCR text cached per page
-
Structure the OCR text into entries
A language model (Gemini) turns each page's OCR text into fields: Khmer headword, English, French, part of speech, definition, examples. It is given text only, never the page image — shown images, it invented titles that were not on the page. The instructions forbid correcting or translating anything.
scripts/extract_new_sources.py
-
Clean and normalise
Item numbers and gloss markers (
អ.,បារ.) are stripped. Characters from other scripts that look like Khmer are repaired, marks are put into canonical order — which Unicode's own normalisation cannot do for Khmer — and a subscript ro typed in the wrong order is fixed.khmerlex/normalize.py · khmerlex/contamination.py
-
Merge and de-duplicate
An entry with the same Khmer and English as one already present is not added again. Ids are stable: new sources are appended after the existing entries. The recovered documents yielded 2,697 entries, of which 768 were new; most of the rest were terms first published in earlier bulletins.
scripts/merge_new_sources.py
-
Validate, or fail the build
Every build counts its detectable defects — empty fields, duplicates, characters out of range, implausibly long or short terms — and fails if any count is worse than the committed baseline. It then stamps a content-addressed build id, so the same data always has the same id.
scripts/validate_lexicon.py · dist/quality_baseline.json · dist/manifest.json
-
Measure accuracy against the printed page
A seeded random sample of entries is checked, character by character, against crops of the source page. See §5.
scripts/evaluate_sample.py · EVALUATION.md
-
Publish
The code, reports, provenance and a 309-entry sample go to GitHub and are archived on Zenodo with a DOI. The full lexicon is loaded by this site from private storage and reached through search and the API. A TBX export exists for terminology tools.
scripts/export_tbx.py · CITATION.cff
2 NLP methods
Khmer is a low-resource language with a script that breaks many assumptions built into text tools. These are the methods each step relies on, and why the obvious alternative fails for Khmer.
Script and encoding
- Grapheme clusters (UAX #29)
- Khmer is an abugida: a syllable is a base consonant plus subscript
consonants joined by COENG and vowel marks, several code points drawn
as one unit.
ក្រសួងis 6 code points but 3 clusters. Every length, slice, edit distance and match boundary in this project is measured in clusters, never code points. - Canonical mark ordering
- Unicode normalisation (NFC) cannot unify Khmer typed in different mark orders: only 2 of the block's 114 characters have a non-zero combining class, so NFC treats everything else as already ordered. The same word can then be byte-different forever. A Khmer-specific reordering fixes it at build time.
- Script contamination and confusables (UTS #39)
- A Devanagari or Thai vowel sign can sit inside a Khmer word, invisible on screen, and the word stops matching anything. Same-letter pairs across Brahmic scripts are derived from Unicode character names (195 pairs), visual lookalikes from the Unicode confusables data.
khmerlex/graphemes.py
khmerlex/normalize.py
khmerlex/contamination.py
Extraction
- OCR
- Google Cloud Vision reads rendered page images. The PDFs' own text layers are not used: legacy Khmer fonts map glyphs to the wrong Unicode, and ្ត and ្ដ are encoded as one mis-mapped glyph.
- LLM information extraction
- A language model maps unstructured OCR text onto a fixed schema (headword, glosses, part of speech, definition, examples): slot filling, with instructions to copy and never correct. It sees text only, because with page images it hallucinated titles. One prompt per page layout: a prompt tuned for gloss-led glossaries shifted definitions onto the wrong entries in numbered tables.
- Output verification
- Each extracted headword is checked against the OCR text it came from, anchored at the start of a line, with line wraps and item numbers allowed. This catches a model dropping a character the OCR read correctly, which a plain substring test cannot see.
scripts/extract_new_sources.py
PROMPT_NUMBERED · PROMPT_GLOSS
verify_against_ocr()
Building the lexical resource
- Near-duplicate detection
- A symmetric-deletion index (the idea behind SymSpell) finds every pair of forms one cluster apart without comparing all pairs. Levenshtein distance over clusters then confirms each pair, and a shared English gloss separates spelling variants from different words.
- Character confusion model
- How often people actually confuse two Khmer characters, aggregated from 3.2M searches (seanghay/khmer-character-confusions). This turns "these look similar" into a measured likelihood that a difference is a misread.
- Validation against a reference dictionary
- Errors that turn one real word into another are found by comparison with the Royal Academy's 2022 dictionary (38,694 headwords). Absence proves nothing, because glossaries coin new terms. The test is narrower: one plausible cluster substitution away from a dictionary word, with compounds split into dictionary headwords and skipped first.
scripts/find_near_duplicates.py
data/khmer-character-confusions.csv
scripts/check_against_rac.py
Evaluation
- Stratified sampling and weighted estimation
- A seeded sample with a per-source floor, so small sources are covered. Each source is weighted by its true size when combining, so the floor does not bias the overall rate.
- Wilson score intervals
- Error rates are reported as intervals, not point estimates. The Wilson interval stays valid near 0% and with small samples, where the normal approximation gives impossible or overconfident ranges.
- Annotation guidelines and error typology
- Judged against what the page printed, not what is correct. Errors are classed (dropped vowel or subscript, truncation at a wrap, dropped second form, substituted letter) so each can be traced to OCR or extraction. Inter-annotator agreement is not yet measured: one annotator.
scripts/evaluate_sample.py
wilson()
EVALUATION.md
Using the lexicon
- Word segmentation
- Khmer writes no spaces between words. A conditional random field
segmenter (khmer-nltk) supplies word boundaries, so a term found inside a
longer unrelated word —
ប្រកinsideប្រកាស— is rejected. - Multi-pattern matching (Aho–Corasick)
- Every term is found in a draft in one pass, at a cost that depends on the draft's length, not the lexicon's size. Measured: below about 220 terms a naive loop is faster.
- Typo-tolerant and phonetic retrieval
- A query with no exact match gets entries one cluster away, from the same deletion index. A deliberately lossy Latin search key lets someone who knows a word by sound find it: "tinnany" reaches ទិន្នន័យ.
- Terminology interchange (TBX)
- Exported as TBX-Basic (ISO 30042:2019), one concept per entry with Khmer, English and French sections and concept-level provenance, for termbases and computer-assisted translation tools.
- Data statement
- Documentation in the schema of Bender & Friedman (2018), so anyone training or evaluating on the data knows its variety, provenance and limits. See §4.
khmerlex/checker.py
khmerlex/aho.py
khmerlex/dictionary.py · khmerlex/romanize.py
scripts/export_tbx.py
DATA_STATEMENT.md
3 Sources
Every entry names its source, issuing body and year. The link is the most official place the document can still be found; its status says how far that was checked.
| Source | Issued by | Year | Entries | Added | Where to find it |
|---|---|---|---|---|---|
rac-new-words |
Royal Academy of Cambodia (National Language Institute) | 2018 | 1,223 | v1.0 | unrecorded |
nckl-country-and-city-names |
National Council of Khmer Language (NCKL) | 2013 | 510 | v1.0 | unrecorded |
nckl-bulletin-vol7-2015 |
National Council of Khmer Language (NCKL) | 2015 | 508 | v1.0 | unrecorded |
pentagonal-strategy-phase1 |
Royal Government of Cambodia | 2023 | 486 | v1.0 | unrecorded |
nckl-technology-and-science |
National Council of Khmer Language (NCKL) | 2014 | 467 | v1.0 | unrecorded |
nckl-bulletin-vol8-2017 |
National Council of Khmer Language (NCKL) | 2017 | 466 | v1.0 | unrecorded |
nckl-bulletin-vol4-2012 |
National Council of Khmer Language (NCKL) | 2012 | 418 | v1.0 | unrecorded |
nckl-bulletin-vol9-2018 |
National Council of Khmer Language (NCKL) | 2018 | 376 | v1.0 | unrecorded |
council-of-ministers-legal-terms |
Council of Ministers | 2007 | 373 | v1.0 | unrecorded |
mptc-digital-lexicon |
Ministry of Post and Telecommunications (MPTC) | 2025 | 279 | v1.0 | unrecorded |
nckl-economics |
National Council of Khmer Language (NCKL) | 2019 | 216 | v1.0 | unrecorded |
nckl-bulletin-vol10-2019 |
National Council of Khmer Language (NCKL) | 2019 | 200 | v1.0 | unrecorded |
nckl-medicine-and-agriculture |
National Council of Khmer Language (NCKL) | 2015 | 180 | v1.0 | unrecorded |
nckl-bulletin-vol3-2010 |
National Council of Khmer Language (NCKL) | 2010 | 167 | v1.0 | unrecorded |
nckl-culture-and-fine-arts |
National Council of Khmer Language (NCKL) | 2015 | 148 | v1.0 | unrecorded |
nckl-health |
National Council of Khmer Language (NCKL) | 2019 | 134 | v1.0 | unrecorded |
nckl-bulletin-vol5-2013 |
National Council of Khmer Language (NCKL) | 2013 | 124 | v1.0 | unrecorded |
nckl-political-science-and-diplomacy |
National Council of Khmer Language (NCKL) | 2014 | 121 | v1.0 | unrecorded |
nckl-linguistics-and-literature |
National Council of Khmer Language (NCKL) | 2013 | 111 | v1.0 | unrecorded |
nckl-bulletin-vol2-2009 |
National Council of Khmer Language (NCKL) | 2009 | 103 | v1.0 | unrecorded |
nckl-philosophy |
National Council of Khmer Language (NCKL) | 2019 | 47 | v1.0 | unrecorded |
nckl-bulletin-vol6-2014 |
National Council of Khmer Language (NCKL) | 2014 | 45 | v1.0 | unrecorded |
- verified
- re-downloaded; checksum identical to the file that was read
- content-identical
- a copy downloads from the Ministry of Education's Sala Digital library; different bytes, every page renders identically
- size-match
- the link answers with the same byte size; not re-hashed
- listed-but-unreachable
- listed on the NCKL site, but its file host no longer resolves
- archived-only
- recovered from a Wayback Machine capture; the original link returns 404
Source PDFs are not redistributed here. That so many official links are already dead is a preservation problem for Khmer terminology, not only for this dataset.
4 Data statement
Summarised from the full statement, which follows Bender & Friedman (2018), Data Statements for NLP. Read DATA_STATEMENT.md →
- Curation rationale
- Government bodies publish the approved Khmer forms of technical, legal and policy terms as scanned PDFs. The aim is to make them checkable rather than guessed. Documents, not words, were selected: every term in a chosen document is included, apart from exact repeats, Bulletin No. 2's word-formation tables (a grammar exercise), and 18 entries that were empty or plainly broken.
- Language variety
- Standard written Khmer (
km, ISO 639-3khm) in the formal register of government publication, often neologisms coined by the issuing body. English and French are glosses, present where the source was bilingual or trilingual. - Authorship
- Institutional; individual committee members are not named in the sources.
- Annotation
- None added. Part of speech, category and definition are
transcriptions of what the documents printed, inconsistencies included:
the
posfield mixes Khmer abbreviations, English labels and French gender markers. - Text characteristics
- Terms, not running text — usually one to five words, with one- or two-sentence Khmer definitions. Field coverage:
- Provenance
- Every entry is OCR output structured by a language model. Both steps make errors, and no entry has been confirmed by a human reader against its page. Publication years span 2007–2025.
- Personal data
- None. Published terminology only.
5 Evaluation
Automatic checks find empty fields and stray characters. They cannot see the error that matters most: an OCR misread that turns one real Khmer word into another. Only the printed page can show that, so the entries were sampled and checked against it.
Method
- Sample. Stratified random sample across sources, seed 20260907, fixed before any row was checked.
- Judged against what the document printed, not what is correct: a ministry's own typo reproduced faithfully counts as right. Any difference in characters — one vowel, one subscript — counts as wrong.
- Checked on crops of the headword's cell at 300 dpi, zoomed to 600–700 dpi wherever a mark was in doubt, with code points compared when a word looked right but would not match.
- Scored with Wilson 95% intervals, each source weighted by its true size so that small sources don't distort the total.
- Excluded by design: entries containing ្ត or ្ដ, which print identically and cannot be judged by eye. They are listed for checking against the Chuon Nath dictionary instead.
The 15 original sources · 2026-09-14
Covers 3,807 of 5,934 entries. Most errors (21 of 34) are one dropped vowel or subscript: ឥណ្ឌា read as ឥណ្ឌ.
The 7 recovered sources · 2026-09-15
A first pass found 46 Khmer errors. 19 came from the structuring step — headwords cut at a line wrap, second forms dropped — so the extraction was fixed and the same rows re-checked. That makes it a paired re-check, not a fresh sample.
What these figures do not tell you
- One annotator. One annotator, an ai model reading rendered source pages; not yet confirmed by a native khmer reader. Read the rates as provisional.
- Three original sources could not be checked this way: the Royal Academy's new-words dictionary and the Pentagonal Strategy glossary (image-only scans), and NCKL Bulletin No. 4 (a legacy-font text layer).
- Nothing about missing terms. A term the OCR dropped never reaches the data, so it can never be sampled.
6 Known defects
Counted on every build. The build fails if any of these grows.
- 1,832
- entries with no English gloss, mostly from Khmer-only documents
- 253
- Khmer forms that appear more than once, often with different glosses
- 417
- pairs one syllable apart that share an English gloss — probably one term spelled two ways
- 347
- single-word terms one plausible misread from a Royal Academy dictionary word (original sources only)
- 150
- headwords longer than 20 syllables, some of them definition text in the wrong field
- 24
- entries with no Khmer form
- 21
- Khmer fields with no Khmer in them: old-font text read as Latin
These are only the errors a program can see. The error rate in §5 is the better guide. Report an error →
7 Access, licence, citation
Access
The full dataset is not published. Search it on this site, or look terms up through the API, which has no bulk endpoint and no pagination. The GitHub repository carries the code, the reports, the provenance and a 309-entry sample. For research that needs the whole dataset, ask.
Licence
CC BY-SA 4.0. The licence covers the compilation: the pipeline, normalisation and merge rules, provenance and the arrangement of entries. The terms themselves were published by Cambodian government bodies and are not claimed. When a term's official status matters, cite the originating document.
Cite
Soeung, P. (2026). Khmer Official Terminology (khmer-lexicon) (Version 1.1.0) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.22761423
All versions: 10.5281/zenodo.22746199. Not an official publication of the Royal Government of Cambodia.