Search code examples
python-3.xdatasetnltkcorpus

how to list all downloaded datset from nltk


I downloaded some of the datasets from nltk using

import nltk
import nltk.corpus 
nltk.download()

Now I want to list all the downloaded dataset I don't know how.


Solution

  • You need to find a path where the downloads are stored. It should be nltk.data.path.

    Also, try using nltk.data.find:

    import os
    import nltk
    
    print(os.listdir(nltk.data.find("corpora")))