Is there any way to add a new location to the list of places where nltk looks for the wordnet corpus?

Posted by Programming Noob on Ask Ubuntu See other posts from Ask Ubuntu or by Programming Noob
Published on 2012-11-01T04:25:16Z Indexed on 2012/11/08 5:19 UTC
Read the original article Hit count: 463

Filed under:

I can't use the nltk wordnet lemmatizer because I can't download the wordnet corpus on my university computer due to access rights issues.

I get the following error when I try to do so:

**********************************************************************   Resource 'corpora/wordnet' not found.  Please use the NLTK   Downloader to obtain the resource:  >>> nltk.download()   Searched in:
    - '/home/XX/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/usr/local/lib/nltk_data'
**********************************************************************

When I had the same issue at home, I could resolve it by two ways:

  1. Using nltk.download(), the standard way and
  2. Creating a new folder at location /home/XX/nltk_data and just pasting the corpus directory inside it.

Now at the university I only have access to /home/XX/bin and not /home/XX directly. So is there anyway I could paste the wordnet corpus into /home/XX/bin and then somehow make nltk look for the corpus in that folder?

© Ask Ubuntu or respective owner

Related posts about python