khmer-text-corpus
收藏资源简介:
该数据集是一个经过清洗和去重的高棉语(柬埔寨语)文本语料库,其核心特点是包含自然发生的高棉语/英语语码转换现象,例如嵌入在文本中的英语科技金融术语、拉丁字母和数字。它专门用于训练SentencePiece分词器以及作为高棉语扩散解码器的文本预热启动数据。语料库共包含4,893,739个句子,以UTF-8编码,每行一个句子,并已进行去重和基于固定种子的洗牌处理以保证可复现性。数据集提供两个并行的配置版本:raw配置包含原始的自然高棉文本,无人工添加的词边界空格,适用于通用目的;segmented配置则对相同的句子进行了分词处理,并应用了地名录和拉丁文本掩码,使其可直接用于子词训练。数据来源于四个部分的混合:大规模原始高棉文本、合成OCR收据/标签文本、本地预分块文本和高棉新闻标题。所有高棉语/英语混合内容均完全来自真实来源,未注入任何合成的语码转换。预处理包括标准化、丢弃空值或无效标签,并保留高棉语词间距、标点符号、数字以及英语/拉丁语标记。对来自Hub的句子应用了长度限制。该数据集为纯文本,不含标签、翻译或任务注释。它主要适用于语言建模、掩码语言建模等文本生成任务,尤其适用于研究低资源语言处理、语码转换现象,或作为高棉语NLP模型的预训练数据。用户需注意数据可能包含非标准拼写、杂散符号和OCR伪影等真实世界噪声,且未针对个人身份信息进行过滤。
This dataset is a cleaned and deduplicated Khmer (Cambodian) text corpus, with the core characteristic of containing naturally occurring Khmer/English code-switching phenomena, such as embedded English technical/financial terms, Latin letters, and numbers. It is specifically designed for training SentencePiece tokenizers and serving as text warm-up data for Khmer diffusion decoders. The corpus contains 4,893,739 sentences, encoded in UTF-8, with one sentence per line, and has undergone deduplication and shuffling based on a fixed seed to ensure reproducibility. The dataset offers two parallel configuration versions: the raw configuration contains original natural Khmer text without artificially added word boundary spaces, suitable for general purposes; the segmented configuration applies tokenization to the same sentences using `khmer-nltk`, along with gazetteer and Latin text masking, making it directly usable for subword training without re-running tokenization. The data is sourced from a mix of four components: large-scale raw Khmer text, synthetic OCR receipt/label text, locally pre-chunked text files, and Khmer news headlines. All Khmer/English mixed content originates entirely from these real sources, with no synthetic code-switching injected. Preprocessing includes normalization (conversion to strings, trimming, replacement of newlines/tabs with single spaces, merging duplicate whitespace), discarding null or invalid labels (e.g., ???, NULL), and preserving Khmer word spacing, punctuation, Khmer/Arabic numerals, and English/Latin tokens. A length limit of 5-400 characters was applied to sentences from the Hub (excluding local file chunks). The dataset is plain text, containing no labels, translations, or task annotations. It is primarily suitable for text generation tasks such as language modeling and masked language modeling, particularly for research on low-resource language processing, code-switching phenomena, or as pre-training data for Khmer NLP models. Users should note that the data may contain real-world noise such as non-standard spellings, stray symbols, and OCR artifacts, and has not been filtered for personally identifiable information.
数据集名称
Khmer + English Mixed Text Corpus(高棉语 + 英语混合文本语料库)
数据集简介
该数据集是一个经过清洗和去重的高棉语文本语料库,包含自然出现的高棉语/英语代码混合现象(如英语技术、金融术语、拉丁字母和数字嵌入高棉语文本中)。它被用作 SentencePiece 分词器和共享高棉语扩散解码器的文本预热训练数据。
数据集规模
- 总句子数:4,893,739 条句子,每行一条,UTF-8 编码,已去重并随机打乱(固定随机种子 42,可复现)。
- 大小类别:1M < n < 10M。
数据集结构
数据集提供两个并行的配置(Config):
| 配置(Config) | 文件 | 描述 |
|---|---|---|
raw(默认) |
all_text.txt |
自然高棉语文本,无人工词边界空格,适用于通用目的。 |
segmented |
all_text_segmented.txt |
相同的 4,893,739 条句子,经过 khmer-nltk 分词处理,并进行了地名/拉丁语掩码,可直接用于 SentencePiece 风格的子词训练。 |
数据实例
每条数据只有一个字段 text:一条归一化的句子。在 segmented 配置中,句子中的高棉语词之间用显式空格分隔。
数据划分
仅包含一个 train 训练集划分,无验证集或测试集。
数据来源
数据集由四个来源混合、去重并打乱构建而成,总量上限为 5,000,000 条句子:
| 来源 | 字段 | 描述 | 采集数量(去重前) | 占比 |
|---|---|---|---|---|
nphearum/khmer-raw-text-3M-v2 |
text | 大规模原始高棉语文本(按高棉语句号 ។ 分割) |
4,836,355 | 96.7% |
Sokheng/khmer-synthetic-ocr-v1-100k |
text | 合成 OCR 收据/标签文本(高棉语/英语/数字混合) | 93,293 | 1.9% |
khmer_corpus.txt |
line | 预分块的约 1000 字符高棉语文本块(本地文件) | 35,373 | 0.7% |
rinabuoy/aupp-assignment-data |
title | 高棉语新闻标题 | 34,991 | 0.7% |
高棉语/英语的混合完全来源于上述真实数据,未注入任何合成代码切换。
数据预处理与筛选
- 归一化:每条句子强制转为字符串、去除首尾空格、将换行符/制表符替换为单个空格、合并重复空白、丢弃空值及无效标签(
???、NULL、N/A、UNKNOWN)。 - 长度过滤:Hub 来源的句子保留长度在 5-400 字符范围内;本地文件不受长度限制。
- 去重与打乱:使用固定随机种子 42 进行去重和打乱。
- 分词版本处理:
segmented配置额外运行khmer-nltk分词,并在分词前掩码英语/数字跨度及已知借词/缩写(如 ATM、ABA、PDF 等),同时对连续的英语/拉丁字母运行基于频率的词分割,并受领域异常列表保护(如 ACLEDA、Bakong、COVID-19、5G 等)。
使用注意事项
- 已知噪声:本地
khmer_corpus.txt和 Hub 原始网页抓取来源包含非标准拼写、杂乱符号和 OCR 伪影,为真实世界抓取文本,非精心策划编辑的语料。 - 个人隐私信息(PII):未针对个人隐私信息进行过滤,仅执行了基本的无效标签规则。
- 纯文本:无标签、翻译或任务注释。
- 分词准确性:分词版本基于统计 CRF 模型,未针对此语料库逐行评估,应视为“降低跨词标记融合”而非“手工验证完美”。
许可协议
该语料库衍生自第三方数据集,并继承其许可证。许可证字段设为 other,需用户自行确认各来源的许可条款。





