I have a list of product names in Chinese. I want to translate these into English, I have tried Google AJAX language API, but it seems that translation is not good, it would be great if someone could give me some advice about or point me towards a better choice.
Thank you.
问问题
4271 次
2 回答
3
嗯,谷歌当然是一个很棒的翻译服务,但如果你正在寻找可靠的翻译,你可能需要人工翻译——机器翻译充其量只能是粗略的。myGengo有一个便于机器翻译的 API;你的问题被标记为“python”,所以我在下面抛出了一些示例代码,但如果你愿意,你可以获得更广泛的演练。
很酷的事情是,您可以在等待人工翻译完成时获得机器翻译,因此如果您在这期间需要一些东西,您不会感到兴奋和干燥。;)
首先,安装适用于 Python 的 mygengo API 库:
pip install mygengo
然后,请求如下翻译:
# -*- coding: utf-8 -*-
from mygengo import MyGengo
gengo = MyGengo(
public_key = 'your_mygengo_api_key',
private_key = 'your_mygengo_private_key',
sandbox = False, # possibly False, depending on your dev needs
)
translation = gengo.postTranslationJob(job = {
'type': 'text', # REQUIRED. Type to translate, you'll probably always put 'text' here (for now ;)
'slug': 'Translating Chinese to English with the myGengo API', # REQUIRED. For storing on the myGengo side
'body_src': '我們今天要去那裏嗎', # REQUIRED. The text you're translating. ;P
'lc_src': 'zh', # REQUIRED. source_language_code (see getServiceLanguages() for a list of codes)
'lc_tgt': 'en', # REQUIRED. target_language_code (see getServiceLanguages() for a list of codes)
'tier': 'standard', # REQUIRED. tier type ("machine", "standard", "pro", or "ultra")
})
# This will print out a machine translation; for your human translation, you can
# poll and check often, or set up a URL for it to post the results to.
print translation['response']['job']['body_tgt']
于 2011-06-01T01:33:45.150 回答
2
我认为谷歌可能是最好的基于网络的自动翻译服务之一。
于 2010-10-20T15:18:29.157 回答