본문 바로가기
-------------코딩-------------/Tensorflow & pandas

nltk 오류 발생 corpus 자료 download

by 탶선 2020. 5. 26.
반응형

NLTK 패키지의 corpus 자료는 설치시 제공되지 않는다 

따라서 download의 명령으로 사용자가 다운로드 받아야 한다.

이걸 몰라서....

from nltk.corpus import stopwords

stop = stopwords.words('english')

# LookupError: 

# **********************************************************************

#  Resource stopwords not found.

#  Please use the NLTK Downloader to obtain the resource:



#   import nltk

#   nltk.download('stopwords')

 

해결방법

  • pip install nltk

#nltk 패키지 설치

 

python 실행 후 

  • import nltk
  • nltk.download('필요한 자료')
    • i.e.   nltk.download('book')
반응형

댓글