这个问题我是从这里得来的,并加入了我的修改。我有以下代码:
from nltk.corpus import stopwords
def content_text(text):
stopwords = nltk.corpus.stopwords.words('english')
content = [w for w in text if w.lower() in stopwords]
return content
如何打印文本中出现频率最高的10个单词,其中1)包括停用词和2)不包括停用词?