多语言翻译模型WiNGPT-Babel-2要来了!
<p>WiNGPT-Babel-2 是一个针对多语言翻译任务优化的语言模型。作为 WiNGPT-Babel 的迭代,它在语言覆盖范围、数据格式处理以及复杂内容的翻译准确性方面均有显著提升。</p><p>该模型延续了“Human-in-the-loop”的训练策略,通过对真实应用场景日志数据的分析不断迭代优化,确保其在实际使用中的有效性和可靠性。</p>
<h2>2.0 版的核心改进</h2>
<p>WiNGPT-Babel-2 与其前身相比引入了以下关键技术升级:</p>
<ol>
<li><strong>扩展语言支持:<strong>通过使用 <code>wmt24pp</code>数据集进行训练,语言支持已扩展到</strong>55 种语言</strong>,主要增强了从英语 (en) 到其他目标语言 (xx) 的翻译能力。</li>
<li>**增强中文翻译:**对其他源语言到中文(xx → zh)的翻译流程进行了专门优化,提高了结果的准确性和流畅性。</li>
<li>**结构化数据翻译:该模型现在可以识别和翻译嵌入在****结构化数据(例如 JSON)**中的文本字段,同时保留原始数据结构。此功能适用于 API 国际化和多语言数据集预处理等场景。</li>
<li><strong>混合内容处理:<strong>其处理混合内容文本的能力得到了改进,能够更准确地翻译包含</strong>数学表达式(LaTeX)、代码片段和网页标记(HTML/Markdown)的段落</strong>,同时保留这些不可翻译元素的格式和完整性。</li>
</ol>
<h2>培训方法</h2>
<p>WiNGPT-Babel-2 的性能提升归功于持续的、数据驱动的、迭代的训练过程:</p>
<ol>
<li>**数据收集:**从集成应用程序(例如,Immersive Translate、Videolingo)收集匿名的、真实的翻译任务日志。</li>
<li>**数据提炼:**利用奖励模型对收集的数据进行拒绝采样,并辅以人工审核,筛选出高质量、高价值的样本,用于构建新的训练数据集。</li>
<li>**迭代再训练:**利用细化后的数据进行模型的增量训练,通过循环迭代的过程不断提升模型在特定领域和场景下的性能。</li>
</ol>
<h2>技术规格</h2>
<ul>
<li><strong>基础模型:</strong> GemmaX2-28-2B-Pretrain</li>
<li><strong>主要训练数据:</strong> “Human-in-the-loop”内部数据集、WMT24++数据集</li>
<li><strong>最大上下文长度:</strong> 4096 个标记</li>
<li>**聊天功能:**支持多轮对话,允许上下文跟进和翻译改进。</li>
</ul>
<h2>语言支持</h2>
<table>
<thead>
<tr>
<th align="left">方向</th>
<th align="left">描述</th>
<th align="left">支持的语言(部分列表)</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><strong>核心支持</strong></td>
<td align="left">最高质量,广泛优化。</td>
<td align="left"><code>en ↔ zh</code></td>
</tr>
<tr>
<td align="left"><strong>扩展支持</strong></td>
<td align="left"><code>wmt24pp</code>通过数据集训练支持。</td>
<td align="left"><code>en → 55+ languages</code>, 包括:<code>fr</code>,<code>de</code>,<code>es</code>,<code>ru</code>,<code>ar</code>,<code>pt</code>,<code>ko</code>,<code>it</code>,<code>nl</code>,<code>tr</code>,<code>pl</code>,<code>sv</code>...</td>
</tr>
<tr>
<td align="left"><strong>增强中文</strong></td>
<td align="left">专门针对中文翻译进行了优化。</td>
<td align="left"><code>xx → zh</code></td>
</tr>
</tbody>
</table>
<h2>使用指南</h2>
<p>为了获得最佳推理性能,建议使用诸如 之类的框架 <code>vllm</code>。以下提供了使用 Hugging Face <code>transformers</code>库的基本使用示例。</p>
<p>**系统提示:**为了获得最佳的自动语言推理效果,建议使用统一的系统提示:<code>Translate this to {{to}} Language</code>。将其替换 <code>{{to}}</code>为目标语言的名称。例如,使用 <code>Translate this to Simplified Chinese Language</code>翻译成中文,或 <code>Translate this to English Language</code>翻译成英文。此方法可以精确控制翻译方向,并获得最可靠的结果。</p>
<h3>例子</h3>
<pre><code>from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "winninghealth/WiNGPT-Babel-2"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# Example: Translation of text within a JSON object to Chinese
prompt_json = """{
"product_name": "High-Performance Laptop",
"features": ["Fast Processor", "Long Battery Life", "Lightweight Design"]
}"""
messages = [
{"role": "system", "content": "Translate this to Simplified Chinese Language"},
{"role": "user", "content": prompt_json} # Replace with the desired prompt
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer(, return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=4096,
temperature=0
)
generated_ids = [
output_ids for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
</code></pre>
<p>WiNGPT-Babel适用场景:https://www.bigseek.com/ai-155-1-1.html</p>
<hr />
等正式上线了,高低得体验一下视频翻译功能了,要是效果好,以后看电影电视剧都不用找字幕了 介绍得挺详细嘛 该模型亮点挺多的 该模型亮点挺多 这模型升级挺厉害 这个模型挺厉害的 这个模型挺厉害的
页:
[1]