2

I know that we can check for resources like this:

try:
  nltk.data.find('tokenizers/punkt')
except LookupError:
  nltk.download('punkt')

But I can't find the way to do this for wordnet:

try:
  nltk.data.find('wordnet') # ????/wordnet
except LookupError:
  nltk.download('wordnet')

How can I make this check?

Stefan Falk
  • 23,898
  • 50
  • 191
  • 378
  • Try `nltk.download('popular')`, see https://stackoverflow.com/questions/22211525/how-do-i-download-nltk-data Alternatively, there's `pip install -U wn` https://github.com/alvations/wordnet – alvas Sep 15 '19 at 12:12

1 Answers1

0

You can do:

nltk.find('corpora/wordnet')
dtrckd
  • 657
  • 7
  • 17
  • hi, can you share the documentation table for this, i could not seem to find a clear list of each – Abhishta Gatya Dec 03 '22 at 18:28
  • i am not sure about the doc, but you can have an exhaustive table of available data with this command: `python -c "import nltk; nltk.download()"` – dtrckd Dec 03 '22 at 23:04