我有一份中文产品名单。我想将这些翻译成英文,我已经尝试过谷歌AJAX语言API,但似乎翻译不好,如果有人可以给我一些建议或指向我更好的选择,那将会很棒。
谢谢。
答案 0 :(得分:3)
很酷的是,你可以在等待人工翻译的同时获得机器翻译,所以如果你在不高和干的时间之间需要某些东西。 ;)
首先,安装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']
答案 1 :(得分:2)
我认为Google可能是最好的基于网络的自动翻译服务之一。