如何下载NLTK数据?NLTK为2.7井工作。我有3.2。我卸载了3.2,安装了2.7。现在起作用了!我已经安装了NLTK并尝试下载NLTK数据。我所做的就是遵照这个网站的指示:http://www.nltk.org/data.html我下载了NLTK,安装了它,然后尝试运行以下代码:>>> import nltk>>> nltk.download()它给了我如下的错误信息:Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
nltk.download()AttributeError: 'module' object has no attribute 'download'
Directory of C:\Python32\Lib\site-packages都试过了nltk.download()和nltk.downloader()都给了我错误信息。然后我用help(nltk)要取出该包,它将显示以下信息:NAME
nltk
PACKAGE CONTENTS
align
app (package)
book
ccg (package)
chat (package)
chunk (package)
classify (package)
cluster (package)
collocations
corpus (package)
data
decorators
downloader
draw (package)
examples (package)
featstruct
grammar
help
inference (package)
internals
lazyimport
metrics (package)
misc (package)
model (package)
parse (package)
probability
sem (package)
sourcedstring
stem (package)
tag (package)
test (package)
text
tokenize (package)
toolbox
tree
treetransforms
util
yamltags
FILE
c:\python32\lib\site-packages\nltk我确实看到下载器在那里,不知道为什么它不工作。Python 3.2.2,System Windows vista。
3 回答
慕尼黑的夜晚无繁华
TA贡献1864条经验 获得超6个赞
sudo easy_install pip
sudo pip install -U numpy
sudo pip install -U nltk
python
import nltk
python -m nltk.downloader all
添加回答
举报
0/150
提交
取消