Variable65536/minicpm5-1b-immersive-translate
Translation • 1B • Updated • 20 • 1
messages listlengths 3 3 |
|---|
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
[
{
"role": "system",
"content": "You are a professional Chinese native translator who needs to fluently translate text into Chinese.\n\n## Translation Rules\n1. Output only the translated content, without explanations or additional content (such as \"Here's the translation:\" or \"Translation as follows:\")\... |
英译中微调数据集,专为沉浸式翻译插件场景设计。用于微调 MiniCPM5-1B-Base,使其在插件运行时稳定遵循翻译规则、保留代码与 HTML 格式、正确处理多段 %% 分隔。
本数据集主要训练以下能力:
%% 段落分隔,输入输出段落数严格一致数据格式为 ShareGPT 对话格式,每条样本包含 system / user / assistant 三角色。
| 来源 | 说明 | 原始规模 | 本数据集采样量 | License |
|---|---|---|---|---|
Mxode/BiST en-zh(arxiv_abstract) |
arXiv 论文摘要英译中,英文为真实语料,中文为 LLM 合成 | 约 263 万行 | ~20,000 | 请参考源仓库 |
FiveC/CoCoDoc-MT-20k |
文档级多语言平行语料,含技术文档 | 20,000 | ~12,000 | 请参考源仓库 |
lianghsun/chinese-english-technical-patent-glossary-chat |
专利技术术语对话数据,反向构造为英→中 | 约 453 万条 | 5,000 | 请参考源仓库 |
Helsinki-NLP/opus-100 en-zh |
通用英中平行语料 | 大规模 | 5,000 | OPUS 各子集不同 |
| 自构造样本 | 代码/HTML/URL 保护、多段 %% 格式 |
— | ~1,600 | 本仓库作者 |
关于 BiST:该子集的英文源文本为真实 arXiv 摘要,中文译文由 LLM 合成。使用时请知悉其合成数据属性。
| 划分 | 样本数 | 文件 |
|---|---|---|
| 训练集 | 17,317 | immersive_zh_train.jsonl |
| 验证集 | 911 | immersive_zh_val.jsonl |
| 合计 | 18,228 |
样本形态分布(近似):
%% 分隔):35%每行一个 JSON 对象,字段如下:
{
"messages": [
{"role": "system", "content": "You are a professional Chinese native translator ..."},
{"role": "user", "content": "Translate to Chinese (output translation only):\n\n..."},
{"role": "assistant", "content": "..."}
]
}
{
"messages": [
{"role": "system", "content": "You are a professional Chinese native translator ..."},
{"role": "user", "content": "Translate to Chinese (output translation only):\n\nThe committee approved the proposal after extensive deliberation."},
{"role": "assistant", "content": "委员会经过充分讨论后批准了该提案。"}
]
}
{
"messages": [
{"role": "system", "content": "You are a professional Chinese native translator ..."},
{"role": "user", "content": "Translate to Chinese:\n\nFirst paragraph.\n\n%%\n\nSecond paragraph."},
{"role": "assistant", "content": "第一段。\n\n%%\n\n第二段。"}
]
}
{
"messages": [
{"role": "system", "content": "You are a professional Chinese native translator ..."},
{"role": "user", "content": "Translate to Chinese:\n\nInstall via `pip install minicpm`. See <a href=\"https://github.com/OpenBMB/MiniCPM\">repo</a> for details."},
{"role": "assistant", "content": "通过 `pip install minicpm` 安装。详情见 <a href=\"https://github.com/OpenBMB/MiniCPM\">repo</a>。"}
]
}
训练数据中的 system 字段完整照抄自沉浸式翻译插件的实际 system prompt,包含:
这确保模型在插件真实请求下具有正确的指令遵循行为。
推荐使用 LLaMA-Factory 进行 LoRA 微调。参考配置:
model_name_or_path: openbmb/MiniCPM5-1B
stage: sft
finetuning_type: lora
lora_rank: 16
lora_alpha: 32
lora_target: all
template: minicpm5
cutoff_len: 768
per_device_train_batch_size: 4
gradient_accumulation_steps: 4
learning_rate: 2.0e-4
num_train_epochs: 2.0
lr_scheduler_type: cosine
warmup_ratio: 0.03
fp16: true
gradient_checkpointing: true
dataset_info.json 示例:
{
"immersive_zh_train": {
"file_name": "immersive_zh_train.jsonl",
"formatting": "sharegpt",
"columns": {"messages": "messages"},
"tags": {
"role_tag": "role",
"content_tag": "content",
"user_tag": "user",
"assistant_tag": "assistant",
"system_tag": "system"
}
},
"immersive_zh_val": {
"file_name": "immersive_zh_val.jsonl",
"formatting": "sharegpt",
"columns": {"messages": "messages"},
"tags": {
"role_tag": "role",
"content_tag": "content",
"user_tag": "user",
"assistant_tag": "assistant",
"system_tag": "system"
}
}
}
| 参数 | 值 |
|---|---|
| temperature | 0.2 |
| top_p | 0.9 |
| max_new_tokens | 512 |
| repetition_penalty | 1.0 |
在 Tesla P100 16GB 上使用上述配置训练 2 epoch:
| 指标 | 值 |
|---|---|
| 最终 eval_loss | 1.1135 |
| 训练集样本 | 17,317 |
| 验证集样本 | 911 |
| LoRA 可训练参数 | 11,206,656(1.03%) |
| 训练轮数 | 2 epoch |
| 硬件 | Tesla P100 16GB |
训练后模型在技术文档、GitHub README、arXiv 摘要的英译中任务上表现良好,代码块、HTML 标签、URL 均能原样保留。
本仓库同时包含从上述 SFT 数据中提取的 imatrix 校准文件:
calibration_merged.txtllama-imatrix 计算重要性矩阵,优化 Q4_K_M 量化%% 数量不完全一致。实际使用中插件通常会剥离代码块,影响较小。Parent、Founded、Industry 等字段的翻译可能不准确,训练数据未覆盖此类结构化字段。after、before 等时间状语从句的语序可能出错。本数据集由多个公开数据源混合而成,各源数据集 License 不同,商用前请逐一确认。自构造样本部分可视为 MIT 许可,但整体数据集建议遵循最严格的源 License。
如果使用本数据集,请同时引用原始数据源及 MiniCPM5:
@misc{minicpm5,
title={MiniCPM5},
author={OpenBMB},
year={2025},
howpublished={\url{https://huggingface.co/openbmb/MiniCPM5-1B}}
}
from datasets import load_dataset
ds = load_dataset("Variable65536/immersive_translate_en-zh")
print(ds["train"][0])