Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Claude 展现出强大的多语言能力,在跨语言的 "zero-shot"(零样本)任务中表现尤为突出。该模型在广泛使用的语言和资源较少的语言中均能保持一致的相对性能,使其成为多语言应用的可靠选择。
除下表中进行基准测试的语言外,Claude 还能够处理许多其他语言。请针对与您的具体用例相关的任何语言进行测试。
下表显示了 Claude 模型在各语言中的零样本 "chain-of-thought"(思维链)评估分数,以相对于英语性能(100%)的百分比表示:
| 语言 | Claude Opus 4.1(已弃用)1 | Claude Sonnet 4.51 | Claude Haiku 4.51 |
|---|---|---|---|
| 英语(基准,固定为 100%) | 100% | 100% | 100% |
| 西班牙语 | 98.1% | 98.2% | 96.4% |
| 葡萄牙语(巴西) | 97.8% | 97.8% | 96.1% |
| 意大利语 | 97.7% | 97.9% | 96.0% |
| 法语 | 97.9% | 97.5% | 95.7% |
| 印度尼西亚语 | 97.3% | 97.3% | 94.2% |
| 德语 | 97.7% | 97.0% | 94.3% |
| 阿拉伯语 | 97.1% | 97.2% | 92.5% |
| 中文(简体) | 97.1% | 96.9% | 94.2% |
| 韩语 | 96.6% | 96.7% | 93.3% |
| 日语 | 96.9% | 96.8% | 93.5% |
| 印地语 | 96.8% | 96.7% | 92.4% |
| 孟加拉语 | 95.7% | 95.4% | 90.4% |
| 斯瓦希里语 | 89.8% | 91.1% | 78.3% |
| 约鲁巴语 | 80.3% | 79.7% | 52.7% |
1 使用扩展思考。
这些指标基于 MMLU(大规模多任务语言理解)英语测试集,该测试集由专业人工翻译人员翻译成 14 种其他语言,详见 OpenAI 的 simple-evals 代码库。此评估采用人工翻译确保了高质量的翻译,这对于数字资源较少的语言尤为重要。
Claude 会从对话中推断响应语言,但对于生产应用,您应明确指定目标语言。最可靠的方式是在系统提示中进行设置,这样可以在对话的每一轮中保持指令的稳定性。
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-opus-4-8",
max_tokens=1024,
system="Always respond in French, regardless of the language the user writes in.",
messages=[{"role": "user", "content": "How do I reset my password?"}],
)
print(message.content)如果您的应用允许用户在运行时选择语言,请将该选择插入到系统提示中,而不是依赖 Claude 从用户消息中推断。若要在两种特定语言之间进行翻译,请同时指明两种语言:Translate the user's message from German to Korean. Respond with only the translation.
处理多语言内容时:
此外,请遵循提示工程概述中的通用指南,以进一步提高输出质量。
应用通用提示技术来提高多语言输出质量。
使用语言受限的系统提示构建本地化的支持聊天机器人。
比较模型层级,在多语言质量与成本和延迟之间取得平衡。
在发布前评估翻译和本地化质量。
Was this page helpful?