Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access wordnet file with nltk without nltk.download()

I'm trying to use wordnet without nltk.download('wordnet') as that function is blocked through the companies IT policy. I have downloaded the wordnet file and unzipped it into my local directory and used nltk.data.path.append("my/wordnet/directory"). When I try and execute a command say "jump" in wn.words() I get the error -

Resource wordnet not found. 
Searched in:
- 'my/wordnet/directory'
- 'standard/directories'

To be clear, IT is fine with me uploading the file directly. How do I get nltk to interact with this file? File found at https://www.nltk.org/nltk_data/ Corpus number 69.

like image 896
thefrollickingnerd Avatar asked Oct 25 '25 06:10

thefrollickingnerd


1 Answers

Found this solution inside the notes: https://www.nltk.org/data.html . After creating the appropriate directories and placing the wordnet files inside the corpora directory and pointing nltk.data.path etc to that directory it worked.

like image 151
thefrollickingnerd Avatar answered Oct 28 '25 00:10

thefrollickingnerd