相关疑难解决方法(0)

如何轻松地用python机器翻译?

您曾经能够用来nltk.misc.babelfish翻译东西,但雅虎Babelfish API却失败了.有没有一种简单的方法可以说,这样做?

>>> import translate
>>> translate('carpe diem', 'latin', 'english')

'seize the day' 
Run Code Online (Sandbox Code Playgroud)

python nltk

13
推荐指数
1
解决办法
6610
查看次数

Python:Goslate翻译请求返回"503:服务不可用"

几个月前,我使用Python的goslate软件包将一堆法语文本翻译成英文.但是,当我今天早上尝试这样做时,该服务返回了一个错误:

import goslate
gs = goslate.Goslate()
print gs.translate('hello world', 'de')

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python27\lib\site-packages\goslate.py", line 389, in translate
    return _unwrapper_single_element(self._translate_single_text(text, target_language, source_language))
  File "c:\Python27\lib\site-packages\goslate.py", line 317, in _translate_single_text
    results = list(self._execute(make_task(i) for i in split_text(text)))
  File "c:\Python27\lib\site-packages\goslate.py", line 200, in _execute
    yield each()
  File "c:\Python27\lib\site-packages\goslate.py", line 315, in <lambda>
    return lambda: self._basic_translate(text, target_language, source_lauguage)[0]
  File "c:\Python27\lib\site-packages\goslate.py", line 241, in _basic_translate
    response_content = self._open_url(url)
  File "c:\Python27\lib\site-packages\goslate.py", line 178, in _open_url …
Run Code Online (Sandbox Code Playgroud)

python translation nlp machine-translation

5
推荐指数
1
解决办法
3726
查看次数

标签 统计

python ×2

machine-translation ×1

nlp ×1

nltk ×1

translation ×1