源代码: https://blog.csdn.net/github_38705794/article/details/75452729

一、复现时报错:

Traceback (most recent call last):
File "D:\Program\python3\lib\site-packages\nltk\corpus\util.py", line 80, in __load
try: root = nltk.data.find('{}/{}'.format(self.subdir, zip_name))
File "D:\Program\python3\lib\site-packages\nltk\data.py", line 675, in find
raise LookupError(resource_not_found)
LookupError:

解决方法:

https://stackoverflow.com/questions/26693736/nltk-and-stopwords-fail-lookuperror

You don't seem to have the stopwords corpus on your computer.

You need to start the NLTK Downloader and download all the data you need.

Open a Python console and do the following:

>>> import nltk
>>> nltk.download()
showing info http://nltk.github.com/nltk_data/

In the GUI window that opens simply press the 'Download' button to download all corpora or go to the 'Corpora' tab and only download the ones you need/want.

 

相关文章:

  • 2021-09-21
  • 2021-12-28
  • 2022-12-23
  • 2021-05-03
  • 2021-08-28
  • 2021-07-16
  • 2021-06-24
  • 2021-09-24
猜你喜欢
  • 2021-08-07
  • 2021-12-12
  • 2021-08-29
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
  • 2021-01-04
相关资源
相似解决方案