所以我正在研究一个示例代码
bag_of_words(words):
return dict([(word, True) for word in words])
feats = bag_of_words(word_tokenize("great movie"))
import nltk.data
classifier = nltk.data.load(classifiers/movie_reviews_NaiveBayes.pickle)
但是我收到了这个错误:
---------------------------------------------------------------------------
LookupError Traceback (most recent call last)
<ipython-input-3-3eff8abb76d8> in <module>()
----> 1 nltk.data.load('classifiers/movie_reviews_NaiveBayes.pickle')
LookupError:
**********************************************************************
Resource u'classifiers/movie_reviews_NaiveBayes.pickle' not
found. Please use the NLTK Downloader to obtain the resource:
>>> nltk.download()
Searched in:
- 'C:\\Users\\shal/nltk_data'
- 'C:\\nltk_data'
- 'D:\\nltk_data'
事情是,我已经下载了完整的NLTK软件包,并且每个月都运行良好,但我碰到了这个我无法解决的错误。任何人都可以提供有关发生的事情的线索。让NLTK的人删除这个包还是什么?