我正在使用python进行NLP,发现了以下错误:
babelize_shell()
NLTK Babelizer: type 'help' for a list of commands.
Babel> how long before the next flight to Alice Springs?
Babel> german
Babel> run
0> how long before the next flight to Alice Springs?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/nltk/misc/babelfish.py", line 175, in babelize_shell
for count, new_phrase in enumerate(babelize(phrase, 'english', language)):
File "/usr/local/lib/python2.7/dist-packages/nltk/misc/babelfish.py", line 126, in babelize
phrase = translate(phrase, next, flip[next])
File "/usr/local/lib/python2.7/dist-packages/nltk/misc/babelfish.py", line 106, in translate
if not match: raise BabelfishChangedError("Can't recognize translated string.")
nltk.misc.babelfish.BabelfishChangedError: Can't recognize translated string.如前所述,我已经导入了nltk.book:
from nltk.book import** NLTK图书的介绍性示例*
装载text1,.,text9和sent1,.,sent9 键入文本或句子的名称以查看它。 输入:“text()”或“sents()”列出材料。 text1:“白鲸”1851年赫尔曼·梅尔维尔著 text2:感觉与情感--简·奥斯丁1811年著 text3:创世记 text4:就职演说语料库 text5:聊天语料库 text6:巨蟒与圣杯 text7:华尔街日报 text8:个人语料库 text9:星期四在G旁边的那个人。K.切斯特顿1908年
有人能帮帮我吗。我是Python新手,不知道错误到底是什么。
发布于 2014-08-29 22:11:55
问题不在于你的代码。问题是babelfish翻译服务不再运行,因此示例代码不再工作。
https://stackoverflow.com/questions/25215887
复制相似问题