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()