0

code:

from nltk.corpus import stopwords
stop = stopwords.words('english')

Error:

---------------------------------------------------------------------------
LookupError                               Traceback (most recent call last)
File ~\anaconda3\lib\site-packages\nltk\corpus\util.py:84, in 
 LazyCorpusLoader.__load(self)
       83 try:
  ---> 84     root = nltk.data.find(f"{self.subdir}/{zip_name}")
       85 except LookupError:

    File ~\anaconda3\lib\site-packages\nltk\data.py:583, in find(resource_name, paths)
       582 resource_not_found = f"\n{sep}\n{msg}\n{sep}\n"
   --> 583 raise LookupError(resource_not_found)

Getting this Error, I am trying the review product by replacing reviews with emoji and English short forms in python.

  • Look at this question and it's answers: https://stackoverflow.com/questions/41610543/corpora-stopwords-not-found-when-import-nltk-library – ditkin Jul 01 '22 at 16:11
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jul 02 '22 at 01:17

1 Answers1

0

You are doing the mistake in the import nltk library .First you can download stopword nltk library then you can used the stopword in you program

Code

import nltk
from nltk.corpus import stopwords
nltk.download("stopwords") 
stop = set(stopwords.words('english'))
stop
Zubair Ali
  • 43
  • 3