我目前已经安装了NLTK,并运行了命令nltk.download()。然而,并不是所有的库都安装好了(它会卡在panlex_lite上)。
问题是,当我试图导入Tokenizer时,会得到以下错误:
文件"create_docs.py",第7行 从nltk.tokenize导入TweetTokenizer ImportError:无法导入 名称TweetTokenizer
我该怎么处理呢?干杯!
发布于 2016-12-01 00:27:52
这是因为没有正确安装库,所以需要跳过"panlex_lite“库并且应该工作。
目前这方面的问题尚未解决,解决办法如下:
I guess, we could add something like if id != 'panlex_lite' to the code...
But, as for me, the easiest way looks like this:
get https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/index.xml
remove panlex from it
upload it to a public Gist
pass the gist's url to the downloader: python -m nltk.downloader -d /usr/local/share/nltk_data -u https://gist.githubusercontent.com/demidovakatya/61dab385d74065ae825c80496a197980/raw/c6ff7fbf44265c7f8c9e961e3e1158cd812d6af1/index.xml all下面是要发布的链接:看最后两次对话
https://stackoverflow.com/questions/40878267
复制相似问题