khmer-qa
收藏资源简介:
Khmer Q&A — context-grounded 是一个开源的高棉语问答/指令微调数据集,专门用于微调高棉语问答大语言模型。该数据集由 iAny(离线高棉语AI平台)构建并开源发布,用于监督微调iAny的本地高棉语LLM,也可用于训练更大模型。数据集包含约2,500个样本,每个样本是一个四元组,包含context(事实性高棉语段落,作为基础来源)、question(关于上下文的高棉语问题)、answer(高棉语答案,可能是简短片段或1-3句解释/摘要)以及type(任务类型:extract、explain或summarize)。数据集中混合了不同类型的任务,旨在解决早期仅抽取式数据集导致模型回答过于简略的问题,通过添加完整的explain和summarize答案,教导模型给出完整回答而非仅提取单词。数据构建过程包括:上下文段落来自高棉语维基百科的干净事实性段落;问答对由Qwen2.5-Instruct模型使用少量高棉语提示生成;通过字符5-gram重叠阈值进行接地过滤,确保答案基于上下文(extract类型要求严格,explain和summarize类型要求较宽松),防止虚构事实同时允许释义。该数据集适用于高棉语LLM的监督微调/指令微调,训练模型基于提供的上下文回答问题(RAG风格)。使用时,可从context和question构建训练提示,以answer为目标;type字段可用于分析/平衡,训练器可忽略。数据集为合成生成,答案由模型生成(基于维基百科,未经过人工验证),尽管有接地过滤,仍可能存在噪声;领域为通用/百科全书式(高棉语维基百科)。数据集采用CC-BY-SA-4.0许可证,上下文段落源自高棉语维基百科(CC-BY-SA-4.0),因此数据集继承该许可证并需遵守相同方式共享要求,需注明维基百科来源。
Khmer Q&A — context-grounded is an open-source Khmer question-answering/instruction fine-tuning dataset, specifically designed for fine-tuning Khmer question-answering large language models. The dataset is constructed and open-sourced by iAny (an offline Khmer AI platform) for supervised fine-tuning of iAnys local Khmer LLMs and can also be used to train larger models. It contains approximately 2,500 samples, each consisting of a quadruple with fields: context (factual Khmer paragraphs serving as the source), question (Khmer questions about the context), answer (Khmer answers, which may be short snippets or 1-3 sentence explanations/summaries), and type (task types: extract, explain, or summarize). The dataset mixes different task types to address the issue of overly brief model responses caused by earlier extractive-only datasets, by incorporating complete explain and summarize answers to teach models to provide full responses rather than just extracting words. The data construction process includes: context paragraphs sourced from clean factual passages of Khmer Wikipedia; question-answer pairs generated by the Qwen2.5-Instruct model using few-shot Khmer prompts; and grounding filtering via character 5-gram overlap thresholds to ensure answers are based on the context (strict for extract types, more lenient for explain and summarize types), preventing factual fabrication while allowing paraphrasing. This dataset is suitable for supervised fine-tuning/instruction fine-tuning of Khmer LLMs, training models to answer questions based on provided context (RAG-style). In use, training prompts can be constructed from context and question, with answer as the target; the type field can be used for analysis/balancing and may be ignored by trainers. The dataset is synthetically generated, with answers produced by models (based on Wikipedia, without human verification), and may contain noise despite grounding filtering; the domain is general/encyclopedic (Khmer Wikipedia). It is licensed under CC-BY-SA-4.0, with context paragraphs derived from Khmer Wikipedia (CC-BY-SA-4.0), so the dataset inherits this license and requires compliance with share-alike terms, with attribution to Wikipedia sources.
数据集概述:Khmer Q&A (context-grounded)
- 数据集名称: Khmer Q&A (context-grounded)
- 许可证: CC-BY-SA-4.0
- 语言: 高棉语 (km)
- 任务类型: 问答 (question-answering)、文本生成 (text-generation)
- 规模: 约 2,500 条样本 (1K < n < 10K)
- 标签: khmer, question-answering, instruction-tuning, sft, synthetic, rag, iany
数据集内容
数据集包含单个 JSON 文件 data.json,每条记录是一个 (context, question, answer) 三元组,答案基于上下文生成。每条记录包含以下字段:
| 字段 | 类型 | 描述 |
|---|---|---|
context |
字符串 | 高棉语事实性段落(作为答案的依据) |
question |
字符串 | 关于上下文的提问(高棉语) |
answer |
字符串 | 答案:短片段或 1–3 句解释/总结(高棉语) |
type |
字符串 | 任务类型:extract(提取)、explain(解释)、summarize(总结) |
示例: json { "context": "ភ្នំពេញ គឺជារាជធានីរបស់ប្រទេសកម្ពុជា。", "question": "តើរាជធានីរបស់កម្ពុជាឈ្មោះអ្វី?", "answer": "ភ្នំពេញ", "type": "extract" }
构建方式
- 来源: 高棉语维基百科的干净事实性段落(
wikimedia/wikipedia,20231101.km版本)。 - 生成方法: 使用 Qwen2.5-Instruct(7B / 14B)模型,配合少样本高棉语提示,按任务类型分别生成问答对。
- 过滤机制: 每个答案必须与上下文有足够的字符 5-gram 重叠(
extract严格,explain/summarize宽松),以排除编造内容,同时允许改写。
完整构建流程见:github.com/sengtha/iAny · docs/BUILD-KHMER-QA-DATASET.md
加载方式
python from datasets import load_dataset ds = load_dataset( "json", data_files="https://huggingface.co/datasets/sengtha/khmer-qa/resolve/main/data.json", split="train", ) print(ds[0])
预期用途
- 用于高棉语大语言模型的监督微调(SFT) / 指令微调,使模型能在给定上下文中进行基于依据的问答。
- 训练时可将
context+question组成提示,answer作为目标;type字段可用于分析或平衡,训练时可忽略。
局限性与负责任使用
- 合成数据:答案由模型生成(基于维基百科,未经人工验证),尽管有过滤机制,仍可能存在噪音。使用前建议抽样检查。
- 领域限制:内容为通用/百科全书性质(高棉语维基百科)。如需特定领域问答,建议自行补充领域段落。
- 非基准/事实真理来源:本数据集仅用于 SFT 训练,不适用于评估或作为真实事实来源。
许可与归属
- 采用 CC-BY-SA-4.0 许可证:上下文段落源自高棉语维基百科(同样为 CC-BY-SA-4.0),因此数据集继承该许可证,使用时需注明维基百科并共享衍生作品。
- Q&A 使用 Qwen2.5(Apache-2.0)生成。
- 由 iAny(E-KHMER Technology)构建并开源发布。




