Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

import nltk;

Now, nltk.data.path is a list of locations where to search for the modules. You can just do:

nltk.data.path.append("your location/directory");
share|improve this answer

It seems that you need to set the environment variable "NLTK_DATA" to tell NLTK where to look. http://nltk.org/data.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.