Babelize_shell () not working

I was going through NLP using python and I encountered the following error:

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.

      

I imported nltk.book as mentioned;

from nltk.book import*

      

* Introductory examples for the NLTK book *

Loading text1, ..., text9 and sent1, ..., sent9

Enter the name of the text or sentence to view it.

Enter: "text ()" or "sents ()" to list the materials.

text1: Moby Dick by Herman Melville 1851

text2: Sense and Sensibility Jane Austen 1811

text3: Genesis

text4: Corpus Inaugural Address

text5: Chat Corpus

text6: Monty Python and the Holy Grail

text7: Wall Street Journal

text8: Personals Corpus

text9: The Man Who Was Thursday by G.K. Chesterton 1908

can someone help me .. I am new to python and do not understand what exactly is going on.

+3


source to share


1 answer


The problem is not with the code. The problem is that the babelfish translation service is no longer running, so the example code no longer works.



More details at https://github.com/nltk/nltk/issues/265

+7


source







All Articles