我已经删除了stopwords,现在我想执行情绪分析,但我的代码显示了一个错误
导入字符串
从nltk.corpus导入停止词
ensw=stopwords.words('english')
从nltk.tokenize导入单词\u tokenize,发送\u tokenize
从textblob导入textblob
导入csv
打开('Huawei Japan Times.csv','r')作为csv\u文件:
csv_reader = csv.reader(csv_file)
next(csv_reader)
for row in csv_reader:
sentence = row[0]
blob = TextBlob(sentence)
new_row = blob.lower()
token = TextBlob(sentence)
article_token = token.words
no_stop = [item for item in article_token if item not in ensw]
print(no_stop)
print()
在这之后,我不知道如何进行情绪分析
目前没有回答
相关问题 更多 >
编程相关推荐