Maschinelle Übersetzung mit babelize_shell () in NLTK
Hallo, ich lerne die Verarbeitung natürlicher Sprachen mit NLTK. Ich versuche, babelize_shell () als Beispiel für das Buch zu implementieren. Was ich tue, ist das Ausführen von babelize_shell (), danach gebe ich meinen String ein, gefolgt von Deutsch, wie im Buch angegeben, gefolgt von Ausführen.
Der Fehler, den ich erhalte, ist:
Traceback (most recent call last):
File "<pyshell#148>", line 1, in <module>
babelize_shell()
File "C:\Python27\lib\site-packages\nltk\misc\babelfish.py", line 175, in babelize_shell
for count, new_phrase in enumerate(babelize(phrase, 'english', language)):
File "C:\Python27\lib\site-packages\nltk\misc\babelfish.py", line 126, in babelize
phrase = translate(phrase, next, flip[next])
File "C:\Python27\lib\site-packages\nltk\misc\babelfish.py", line 106, in translate
if not match: raise BabelfishChangedError("Can't recognize translated string.")
BabelfishChangedError: Can't recognize translated string.
Hier ist eine Beispielsitzung:
>>> 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?
1> wie lang vor dem folgenden Flug zu Alice Springs?
2> how long before the following flight to Alice jump?
3> wie lang vor dem folgenden Flug zu Alice springen Sie?
4> how long before the following flight to Alice do you jump?
5> wie lang, bevor der folgende Flug zu Alice tun, Sie springen?
6> how long, before the following flight to Alice does, do you jump?
7> wie lang bevor der folgende Flug zu Alice tut, tun Sie springen?
8> how long before the following flight to Alice does, do you jump?
9> wie lang, bevor der folgende Flug zu Alice tut, tun Sie springen?
10> how long, before the following flight does to Alice, do do you jump?
11> wie lang bevor der folgende Flug zu Alice tut, Sie tun Sprung?
12> how long before the following flight does leap to Alice, does you?