引入NLTK-punkt工具包出现的问题

1.在使用自然语言工具包NLTK的时候,出现了这样一个问题:Resource puntk not found.Please use the NLTKDownloader to obtain the resource.NLTK-Resource punkt not found2.根据提示,打开cmd窗口,用命令下载punkt.NLTK-Resource punkt not found
出现错误信息:

[nltk_data] Error loading punkt: <urlopen error [Errno 11004]
[nltk_data] getaddrinfo failed>。
百度搜索后,决定尝试用nltk.download()命令进入下载界面进行下载,结果出现[error11004]:getaddrinfo.failed错误。
NLTK-Resource punkt not foundNLTK-Resource punkt not found

我又百度了一下,有人说将server index改成:http://nltk.org/nltk_data/即可解决。于是将Server Index改成:http://nltk.org/nltk_data/,并将下载路径修改(默认下载路径内存不足)。NLTK-Resource punkt not found出现下载界面,选择【Models】模块,选择【punkt】,点击【download】,进入下载状态,一分钟以后报错了
NLTK-Resource punkt not found
菜鸟懵逼!我会就此放弃吗?不会!继续百度。

方法:

1.下载nltk_data(.zip文件已经上传),并在环境变量中设置NLTK_DATA,其值为路径位置。NLTK-Resource punkt not foundNLTK-Resource punkt not found2.运行项目:又报错了。还是提示找不到这个文件。
NLTK-Resource punkt not found解决方法:将package文件夹里面的tokenizers文件夹放到错误提示的任意一个路径下。NLTK-Resource punkt not foundNLTK-Resource punkt not found3.运行项目。成功!

NLTK-Resource punkt not found

相关文章:

  • 2021-10-12
  • 2021-10-24
  • 2021-05-24
  • 2021-09-20
  • 2021-06-08
  • 2021-06-25
  • 2022-12-23
猜你喜欢
  • 2021-07-11
  • 2021-05-09
  • 2021-09-23
  • 2021-12-06
  • 2022-01-13
  • 2021-06-27
  • 2021-10-18
相关资源
相似解决方案