Getting 405 error while trying to download nltk data

前端 未结 2 1397
温柔的废话
温柔的废话 2020-12-03 22:02

When i try the below code

python -c \"import nltk; nltk.download(\'punkt\'); 
nltk.download(\'averaged_perceptron_tagger\'); 
nltk.download(\'maxent_treeba         


        
相关标签:
2条回答
  • 2020-12-03 22:19

    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.

    0 讨论(0)
  • 2020-12-03 22:19

    For MacOSX - small modification to the above answer:

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

    Note that this is a big download (~700MB).

    0 讨论(0)
提交回复
热议问题