試圖在Python中學習NLP和情感分析,並遇到NLTK。有幾個教程,但卡住了標記化函數,因爲它不適用於我(命令行是說我沒有資源)。Python NLTK錯誤:找不到NLTK中的english.pickle資源
我已經嘗試安裝punkt
,儘管已下載,在命令行中仍存在相同的錯誤:
Resource u'taggers/maxent_treebank_pos_tagger/english.pickle'
not found. Please use the NLTK Downloader to obtain the
resource: >>> nltk.download()
Searched in:
- 'C:\\Users\\JeromePogi/nltk_data'
- 'C:\\nltk_data'
- 'D:\\nltk_data'
- 'E:\\nltk_data'
- 'C:\\Python27\\nltk_data'
- 'C:\\Python27\\lib\\nltk_data'
- 'C:\\Users\\JeromePogi\\AppData\\Roaming\\nltk_data'
- u''
我從字面上嘗試了一切,包括把nltk_data夾中的每個它有目錄搜索但無濟於事。我能做些什麼來解決這個錯誤?
可能的重複[無法加載與nltk.data.load英文版](http://stackoverflow.com/questions/4867197/failed-loading-english-pickle-with-nltk-data-load) – alvas
'導入nltk; nltk.download('all')' – alvas
不是重複的,它缺少一個不同的資源。 @Alvas,如果你不知道丟失的特定資源,推薦'nltk.download('book')'就足夠了。 (或避免將來出現類似問題。) – alexis