NLTK电影评论分类器无法正常工作

时间:2014-09-24 14:27:38

标签: python nltk

所以我正在研究一个示例代码

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的人删除这个包还是什么?

0 个答案:

没有答案