Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting 405 error while trying to download nltk data

When i try the below code

python -c "import nltk; nltk.download('punkt'); 
nltk.download('averaged_perceptron_tagger'); 
nltk.download('maxent_treebank_pos_tagger'); 
nltk.download('wordnet')"

the console says

[nltk_data] Error loading punkt: HTTP Error 405: Not allowed.
[nltk_data] Error loading averaged_perceptron_tagger: HTTP Error 405:
[nltk_data]     Not allowed.
[nltk_data] Error loading maxent_treebank_pos_tagger: HTTP Error 405:
[nltk_data]     Not allowed.
[nltk_data] Error loading wordnet: HTTP Error 405: Not allowed.
like image 917
user2478236 Avatar asked Jul 26 '17 05:07

user2478236


People also ask

Where can I download NLTK data?

Download individual packages from https://www.nltk.org/nltk_data/ (see the “download” links). Unzip them to the appropriate subfolder. For example, the Brown Corpus, found at: https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/packages/corpora/brown.zip is to be unzipped to nltk_data/corpora/brown .

What is NLTK download (' Punkt ')?

'] punkt is the required package for tokenization. Hence you may download it using nltk download manager or download it programmatically using nltk.


1 Answers

This is caused by a down-age of Github raw file link.

Meanwhile a stop-gap solution would be to manually download the file:

PATH_TO_NLTK_DATA=/home/username/nltk_data/
wget https://github.com/nltk/nltk_data/archive/gh-pages.zip
unzip gh-pages.zip
mv nltk_data-gh-pages/ $PATH_TO_NLTK_DATA

We're working on finding an alternative to the data and model downloading.

Meanwhile, @everyone please help to check that your script(s) and make sure that you're not overloading the data downloads! Thank you in advance!!

Please check https://github.com/nltk/nltk/issues/1787 for latest updates on this issue.

like image 153
alvas Avatar answered Sep 28 '22 11:09

alvas