NLTK and Stopwords Fail #lookuperror

后端 未结 6 799
我寻月下人不归
我寻月下人不归 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:05

    I tried from ubuntu terminal and I don't know why the GUI didn't show up according to tttthomasssss answer. So I followed the comment from KLDavenport and it worked. Here is the summary:

    Open your terminal/command-line and type python then

    >>> import nltk .>>> nltk.download("stopwords")

    This will store the stopwords corpus under the nltk_data. For my case it was /home/myusername/nltk_data/corpora/stopwords.

    If you need another corpus then visit nltk data and find the corpus with their ID. Then use the ID to download like we did for stopwords.

提交回复
热议问题