NLTK Lookup Error

前端 未结 8 1686
感动是毒
感动是毒 2020-12-14 00:53

While running a Python script using NLTK I got this:

Traceback (most recent call last):
  File \"cpicklesave.py\", line 56, in 
    pos = nltk.         


        
相关标签:
8条回答
  • 2020-12-14 01:40

    Install all nltk resources in one line:

    python3 -c "import nltk; nltk.download('all')"
    

    the data will be saved at ~/nltk_data


    You can also substitute "all" for "averaged_perceptron_tagger" to install only this module.

    0 讨论(0)
  • 2020-12-14 01:41

    Sometimes even by writing nltk.download('module_name'), it does not get downloaded. At those times, you can open python in interactive mode and then download by using nltk.download('module_name').

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