首先,我使用Google colab进行工作, 我已经用以下命令下载了英语的nltk停用词:
nltk.download('stopwords')
下载成功
[nltk_data] Downloading package stopwords to /root/nltk_data...
但是当我运行stop = stopwords.words('English')
我得到OSError: No such file or directory: '/root/nltk_data/corpora/stopwords/English'
答案 0 :(得分:5)
English
应该是小写=)
请参阅:https://colab.research.google.com/drive/1tNt0Ifom-h4OnFBBZpLndYCEPDU598jE
# Downloads the data.
import nltk
nltk.download('stopwords')
# Using the stopwords.
from nltk.corpus import stopwords
# Initialize the stopwords
stoplist = stopwords.words('english')