--- language: - km license: cc-by-4.0 task_categories: - text-generation - fill-mask - token-classification pretty_name: Khmer Education PDF - Role-Playing Teaching Methods (Cleaned) size_categories: - n<1K tags: - khmer - education - pedagogy - unicode-fixed - cambodia - southeast-asia --- # Khmer Education PDF - Role-Playing Teaching Methods (Cleaned) ## Dataset Description This dataset contains cleaned and Unicode-corrected text extracted from a 48-page Khmer educational PDF about role-playing teaching methods (ការបងៀនតាមវិធីសម្មែងតួ). The text has undergone comprehensive Unicode repair to fix 537 orphaned COENG characters and other extraction artifacts. ### Dataset Summary - **Language:** Khmer (km) - **Source:** Educational PDF - "New Generation Pedagogical Research Center" - **Topic:** Role-playing teaching methods and pedagogical research - **Pages:** 48 - **Characters:** 40,806 (after cleaning) - **License:** CC-BY-4.0 ### Supported Tasks - Khmer language modeling - Text generation - Educational content analysis - Tokenization benchmarking - NLP research ## Dataset Structure ### Data Files 1. **pdf_text_fixed.txt** - Main cleaned text file (40,806 characters) 2. **coeng_repair_comparison.txt** - Before/after repair analysis 3. **pdf_unicode_analysis_report.txt** - Original Unicode analysis 4. **FINAL_PDF_ANALYSIS_REPORT.md** - Comprehensive technical report ### Data Fields The main text file (`pdf_text_fixed.txt`) contains: - **Format:** Plain text (UTF-8 encoded) - **Encoding:** Unicode NFC normalized - **Structure:** Sequential page extraction with page markers ## Data Cleaning Process ### Unicode Fixes Applied #### 1. COENG Character Repair (537 fixes) - Removed 295 COENG before vowels - Removed 159 COENG before spaces - Removed 32 COENG before punctuation - Removed 23 COENG before diacritic signs - Fixed 19 double COENG patterns - Removed 8 other orphaned COENG #### 2. Validation Results - ✅ All COENG characters now properly formed (1,753 valid clusters) - ✅ NFC Unicode normalization verified - ✅ No invisible characters (zero-width spaces, joiners) - ✅ Khmer text purity: 85.1% ### Quality Metrics | Metric | Before | After | Improvement | |--------|--------|-------|-------------| | Total characters | 41,343 | 40,806 | -537 | | Token count (km_8k) | 27,249 | 26,556 | -2.5% | | Broken tokens | 13,698 | 13,030 | -4.9% | | Tokens per char | 0.659 | 0.651 | -1.2% | | Avg token length | 1.639 | 1.661 | +1.3% | ## Source Information ### Original PDF Details - **Title:** អនុគរុសកាសលយជំនាន់ថ្មី (New Generation Pedagogical Research Center) - **Subject:** ការបងៀនតាមវិធីសម្មែងតួ (Role-playing teaching methods) - **Author:** Stanislas Kowalski (translated by Khmer educators) - **Year:** 2025 - **Copyright:** © New Generation Pedagogical Research Center - **Pages:** 48 ### Content Overview The document covers: - Student participation and engagement strategies - Vocabulary and grammar training methods - Role-playing teaching principles - Classroom implementation guidelines - Feedback techniques - Time management for role-play activities - Scenario templates (basic, intermediate, advanced levels) - Assessment frameworks ## Limitations and Known Issues ### Remaining Challenges 1. **Elevated TPC:** 0.651 (target: 0.40-0.45) - Indicates remaining text extraction quality issues - ~13,000 broken single-character tokens persist 2. **Word Spacing:** Some incorrect word boundaries remain - Missing spaces between words - Extra spaces within words 3. **OCR Artifacts:** Minor character substitutions may exist ### Recommended Use - ✅ Educational content analysis - ✅ Khmer NLP research and development - ✅ Tokenization benchmarking - ✅ Language model pre-training (after additional cleaning) - ⚠️ Requires further word segmentation for production use ## Usage Example ### Load Text ```python from datasets import load_dataset # Load the dataset dataset = load_dataset("khopilot/khmer-education-pdf-cleaned") # Access the text text = dataset['train']['text'][0] print(f"Text length: {len(text):,} characters") ``` ### Tokenization Test ```python import sentencepiece as spm # Load km_8k_production tokenizer sp = spm.SentencePieceProcessor() sp.load("path/to/km_8k_production/tokenizer.model") # Tokenize tokens = sp.encode_as_pieces(text) print(f"Token count: {len(tokens):,}") print(f"TPC: {len(tokens) / len(text):.3f}") ``` ## Citation If you use this dataset, please cite: ```bibtex @dataset{khmer_education_pdf_cleaned_2025, title={Khmer Education PDF - Role-Playing Teaching Methods (Cleaned)}, author={Kowalski, Stanislas and Khmer Pedagogical Team}, year={2025}, publisher={HuggingFace}, url={https://huggingface.co/datasets/khopilot/khmer-education-pdf-cleaned}, note={Unicode-corrected text with 537 COENG repairs} } ``` ## Dataset Creation ### Curation Process 1. PDF text extraction using `pypdf` 2. Unicode analysis with custom tools 3. Automated COENG repair (537 fixes) 4. Validation with km_8k_production tokenizer 5. Quality metrics calculation ### Tools Used - Python 3.14 - pypdf 6.1.1 - sentencepiece 0.2.1 - khmer-data-curation-toolkit v1.0.0 ### Processing Scripts Available in the repository: - `analyze_pdf_unicode.py` - Unicode analysis - `fix_pdf_coeng.py` - COENG repair - See `FINAL_PDF_ANALYSIS_REPORT.md` for full methodology ## License **Text Content:** CC-BY-4.0 (attributed to original authors) **Processing Scripts:** MIT License Original copyright: © 2025 New Generation Pedagogical Research Center ## Contact - **Curator:** khopilot - **Repository:** https://github.com/khopilot/khmer-data-curation-toolkit - **Issues:** Report data quality issues via HuggingFace discussions ## Changelog ### Version 1.0 (2025-10-13) - Initial release - Fixed 537 orphaned COENG characters - Added comprehensive documentation - Validated with km_8k_production tokenizer --- **Last Updated:** October 13, 2025 **Dataset Version:** 1.0 **Status:** Stable