Resource 'taggers/averaged_perceptron_tagger/averaged_perceptron _tagger.pickle' not found.

1. 错误如下:


LookupError:

**********************************************************************

  Resource 'taggers/averaged_perceptron_tagger/averaged_perceptron

  _tagger.pickle' not found.  Please use the NLTK Downloader to

  obtain the resource:  >>> nltk.download()

  Searched in:

    - 'C:\\Users\\Dream^hao`/nltk_data'

    - 'C:\\nltk_data'

    - 'D:\\nltk_data'

    - 'E:\\nltk_data'

    - 'E:\\anaconda3.5\\nltk_data'

    - 'E:\\anaconda3.5\\lib\\nltk_data'

    - 'C:\\Users\\Dream^hao`\\AppData\\Roaming\\nltk_data'

**********************************************************************

2. 解决方法:

  1. 下载下面的文件:

链接:https://pan.baidu.com/s/11M1HkeibAd50oU-OmELorQ

提取码:bcvr

  1. 在编写python代码的工具中输入以下代码,得到nltk_data的路径:

import nltk

nltk.data.path

我的结果是:

image
  1. 将上面下载的文件解压到上面的某个目录中,我解压到的是C:\Users\Dream^hao\AppData\Roaming\nltk_data
image

4. 然后程序就可以正常运行了:

image
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容