【发布时间】:2021-08-09 03:32:13
【问题描述】:
我想在 python 中使用 nltk 库。 但是当我运行代码时出现此错误:
LookupError:
**********************************************************************
Resource stopwords not found.
Please use the NLTK Downloader to obtain the resource:
>>> import nltk
>>> nltk.download('stopwords')
For more information see: https://www.nltk.org/data.html
Attempted to load corpora/stopwords
Searched in:
- 'C:\\Users\\Hossein M/nltk_data'
- 'C:\\Users\\Hossein M\\AppData\\Local\\Programs\\Python\\Python39\\nltk_data'
- 'C:\\Users\\Hossein M\\AppData\\Local\\Programs\\Python\\Python39\\share\\nltk_data'
- 'C:\\Users\\Hossein M\\AppData\\Local\\Programs\\Python\\Python39\\lib\\nltk_data'
- 'C:\\Users\\Hossein M\\AppData\\Roaming\\nltk_data'
- 'C:\\nltk_data'
- 'D:\\nltk_data'
- 'E:\\nltk_data'
**********************************************************************
但我之前是通过nltk.download()命令做到的:
import nltk
nltk.download()
nltk.download('stopwords')
from nltk.corpus import stopwords
set(stopwords.words("english"))
【问题讨论】:
标签: python text nlp nltk text-mining