NLTK and Stopwords Fail #lookuperror

后端 未结 6 786
我寻月下人不归
我寻月下人不归 2020-12-24 00:35

I am trying to start a project of sentiment analysis and I will use the stop words method. I made some research and I found that nltk have stopwords but when I execute the c

6条回答
  •  天涯浪人
    2020-12-24 01:15

    If you want to manually install NLTK Corpus.

    1) Go to http://www.nltk.org/nltk_data/ and download your desired NLTK Corpus file.

    2) Now in a Python shell check the value of nltk.data.path

    3) Choose one of the path that exists on your machine, and unzip the data files into the corpora sub directory inside.

    4) Now you can import the data from nltk.corpos import stopwords

    Reference: https://medium.com/@satorulogic/how-to-manually-download-a-nltk-corpus-f01569861da9

提交回复
热议问题