text
stringlengths 0
104
|
|---|
================================================================================
|
COENG REPAIR COMPARISON REPORT
|
================================================================================
|
1. TEXT STATISTICS
|
--------------------------------------------------------------------------------
|
Original length: 41,343 characters
|
Fixed length: 40,806 characters
|
Characters removed: 537
|
2. COENG CHARACTER ANALYSIS
|
--------------------------------------------------------------------------------
|
Original:
|
Valid COENG (+ consonant): 1753
|
Invalid COENG (orphaned): 537
|
Total: 2290
|
Fixed:
|
Valid COENG (+ consonant): 1753
|
Invalid COENG (orphaned): 0
|
Total: 1753
|
Improvement:
|
✅ Removed 537 orphaned COENG characters
|
✅ Reduced invalid COENG from 537 to 0
|
3. FIXES APPLIED
|
--------------------------------------------------------------------------------
|
before_vowel: 295 fixes
|
before_space: 159 fixes
|
before_punctuation: 32 fixes
|
before_sign: 23 fixes
|
double_coeng: 19 fixes
|
before_newline: 5 fixes
|
before_other: 4 fixes
|
4. SAMPLE FIXES (First 10)
|
--------------------------------------------------------------------------------
|
1. Position 31 - before_sign
|
Before: 'វគរុកោសលយជ្'
|
After: 'ំនាន់ថ្មី'
|
Removed COENG before: ំ (U+17C6)
|
2. Position 367 - double_coeng
|
Before: 'ញ្ចូលកែុងទ្'
|
After: '្មង់ណាមួយ'
|
Removed COENG before: ្ (U+17D2)
|
3. Position 470 - before_vowel
|
Before: 'និកសនេងៗសទ្'
|
After: 'ៀត សោយមិន'
|
Removed COENG before: ៀ (U+17C0)
|
4. Position 569 - before_newline
|
Before: '្មាប់េតថបទ្'
|
After: '\nវិចារណកថ'
|
Removed COENG before:
|
(U+000A)
|
5. Position 774 - double_coeng
|
Before: 'alski \nបកម្'
|
After: '្បជាភាសាម'
|
Removed COENG before: ្ (U+17D2)
|
6. Position 850 - before_vowel
|
Before: 'កាហ្វិចឌើហ្'
|
After: 'ាញ៖ ស'
|
Removed COENG before: ា (U+17B6)
|
7. Position 868 - before_vowel
|
Before: ' សលាក្គូ ជ្'
|
After: 'ី គឹមអុី '
|
Removed COENG before: ី (U+17B8)
|
8. Position 935 - before_vowel
|
Before: '\n \nកសចកែីក្'
|
After: 'ែើម៖ោរដាក'
|
Removed COENG before: ែ (U+17C2)
|
9. Position 1106 - before_space
|
Before: 'និរកវយាករណ្'
|
After: ' ៍ ......'
|
Removed COENG before: (U+0020)
|
10. Position 1158 - before_space
|
Before: ' 9 \nកោលោរណ្'
|
After: ' ៍ សែរ់ដា'
|
Removed COENG before: (U+0020)
|
5. TOKENIZATION QUALITY
|
--------------------------------------------------------------------------------
|
Metric Original Fixed Change
|
--------------------------------------------------------------------------------
|
Token count 27,249 26,556 -693
|
Unique tokens 733 747 +14
|
Avg token length 1.639 1.661 +0.023
|
TPC (tokens/char) 0.659 0.651 -0.008
|
Broken tokens 13,698 13,030 -668
|
6. QUALITY ASSESSMENT
|
--------------------------------------------------------------------------------
|
✅ TPC improved: 0.659 → 0.651
|
✅ Broken tokens reduced: 13,698 → 13,030
|
⚠️ TPC outside target range: 0.651 (target: 0.40-0.50)
|
================================================================================
|
មជ្ឈមណ្ឌ លស្រាវស្រាវគរុកោសលយជំនាន់ថ្មី
|
New Generation Pedagogical Research Center
|
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
- pdf_text_fixed.txt - Main cleaned text file (40,806 characters)
- coeng_repair_comparison.txt - Before/after repair analysis
- pdf_unicode_analysis_report.txt - Original Unicode analysis
- 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
Elevated TPC: 0.651 (target: 0.40-0.45)
- Indicates remaining text extraction quality issues
- ~13,000 broken single-character tokens persist
Word Spacing: Some incorrect word boundaries remain
- Missing spaces between words
- Extra spaces within words
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
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
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:
@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
- PDF text extraction using
pypdf - Unicode analysis with custom tools
- Automated COENG repair (537 fixes)
- Validation with km_8k_production tokenizer
- 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 analysisfix_pdf_coeng.py- COENG repair- See
FINAL_PDF_ANALYSIS_REPORT.mdfor 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
- Downloads last month
- 110