Resource wordnet not found. Please use the NLTK Downloader to obtain the resource:


第一次使用nltk的時候,出現了這樣的錯誤:

from nltk.stem.wordnet import WordNetLemmatizer

lemmatizer = WordNetLemmatizer()
print(lemmatizer.lemmatize('computer'))


原來是需要先在本地下載wordnet
故,在console界面按照提示輸入:

  >>> import nltk
  >>> nltk.download('wordnet')

然后就可以了


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM