随笔 - 12  文章 - 0  评论 - 0  阅读 - 12920

运行nltk示例 Resource u'tokenizers punkt english.pickle' not found解决

nltk安装完毕后,编写如下示例程序并运行,报Resource u'tokenizers/punkt/english.pickle' not found错误

import nltk

sentence = """At eight o'clock on Thursday morning Arthur didn't feel very good."""
tokens = nltk.word_tokenize(sentence)
print(tokens)

解决方法:
编写如下程序并运行,有代理情况下配置代理,运行成功后弹出NLTK Downloader,下载所有包后再次运行示例程序结果正常

import nltk
nltk.set_proxy("**.com:8080","username","password")
nltk.download()

posted on   wihi  阅读(2970)  评论(0编辑  收藏  举报
< 2025年1月 >
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1
2 3 4 5 6 7 8

点击右上角即可分享
微信分享提示