当试图加载punkt
标记器时。。。
import nltk.data
tokenizer = nltk.data.load('nltk:tokenizers/punkt/english.pickle')
…引发了LookupError
:
> LookupError:
> *********************************************************************
> Resource 'tokenizers/punkt/english.pickle' not found. Please use the NLTK Downloader to obtain the resource: nltk.download(). Searched in:
> - 'C:\\Users\\Martinos/nltk_data'
> - 'C:\\nltk_data'
> - 'D:\\nltk_data'
> - 'E:\\nltk_data'
> - 'E:\\Python26\\nltk_data'
> - 'E:\\Python26\\lib\\nltk_data'
> - 'C:\\Users\\Martinos\\AppData\\Roaming\\nltk_data'
> **********************************************************************
这就是我刚才的工作:
句子标记化是一个标记列表:
这些句子取自例子ipython notebook accompanying the book "Mining the Social Web, 2nd Edition"
我也有同样的问题。进入python shell并键入:
然后出现一个安装窗口。转到“Models”选项卡,在“Identifier”列下选择“punkt”。然后单击下载,它将安装必要的文件。那就应该成功了!
使用标记器:)
相关问题 更多 >
编程相关推荐