Bad Zip-Datei Fehler in POS-Tagging in NLTK in Python

Ich bin neu in Python und NLTK ..Ich möchte Word-Tokenisierung und POS-Tagging in diesem tun.Ich habe Nltk 3.0 in meinem Ubuntu 14.04 mit einem Standard-Python 2.7.6 installiert.Als erstes habe ich versucht, Tokenisierung eines einfachen Satzes zu tun.Aber Ich erhalte eine Fehlermeldung mit der Meldung "BadZipfile: Datei ist keine Zip-Datei"

.. Noch ein Zweifel..i.e. Ich habe den Pfad als "/ usr / share / nltk_data" angegeben, als ich Nltk-Daten installiert habe (unter Verwendung der Befehlszeile). Einige der Pakete konnten aufgrund einiger Fehler nicht installiert werden. Aber es werden andere Pfade angezeigt, wenn ich mit dem Befehl "nltk.data" nachgefragt habe. path "und die anderen pfade sind eigentlich ungültig .. warum ???

Ich habe 1000 Textdateien. Wie man ein Programm zur Tokenisierung und POS-Kennzeichnung für so viele Dateien zusammen als Eingabe in Python programmiert. Ich weiß nicht. Bitte helfen Sie mi

Die Art und Weise, wie ich Befehle im Python-Interpretter verwendet habe, ist unten in der gleichen Reihenfolge wie unten angegeben.

Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> import nltk
>>> nltk.data.path
['/home/ubuntu/nltk_data', '/usr/share/nltk_data',       '/usr/local/share/nltk_data', '/usr/lib/nltk_data', '/usr/local/lib/nltk_data']
>>> from nltk import pos_tag, word_tokenize
>>> sentence = "Hello my name is Derek. I live in Salt Lake city."
>>> sentence
'Hello my name is Derek. I live in Salt Lake city.'
>>> word_tokenize(sentence)

Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
word_tokenize(sentence)
File "/usr/local/lib/python2.7/dist-packages/nltk/tokenize/__init__.py",      line 93, in word_tokenize
return [token for sent in sent_tokenize(text)
File "/usr/local/lib/python2.7/dist-packages/nltk/tokenize/__init__.py",   line 81, in sent_tokenize
tokenizer = load('tokenizers/punkt/english.pickle')
File "/usr/local/lib/python2.7/dist-packages/nltk/data.py", line 774, in   load
opened_resource = _open(resource_url)
File "/usr/local/lib/python2.7/dist-packages/nltk/data.py", line 888, in _open
return find(path_, path + ['']).open()
File "/usr/local/lib/python2.7/dist-packages/nltk/data.py", line 605, in find
return find(modified_name, paths)
File "/usr/local/lib/python2.7/dist-packages/nltk/data.py", line 592, in find
return ZipFilePathPointer(p, zipentry)
File "/usr/local/lib/python2.7/dist-packages/nltk/compat.py", line 380, in _decorator
return init_func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/nltk/data.py", line 449, in __init__
zipfile = OpenOnDemandZipFile(os.path.abspath(zipfile))
File "/usr/local/lib/python2.7/dist-packages/nltk/compat.py", line 380, in _decorator
return init_func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/nltk/data.py", line 946, in __init__
zipfile.ZipFile.__init__(self, filename)
File "/usr/lib/python2.7/zipfile.py", line 770, in __init__
self._RealGetContents()
File "/usr/lib/python2.7/zipfile.py", line 811, in _RealGetContents
raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file
>>>

Danke im Voraus....

Antworten auf die Frage(2)

Ihre Antwort auf die Frage