【发布时间】:2020-09-07 00:22:50
【问题描述】:
对于情绪分析项目,我尝试在使用 TextBlob 时添加停用词。我也尝试过结合 NTLK 脚本,但没有运气。这是我在尝试添加停用词之前的代码。
import csv
from textblob import TextBlob
infile = 'File Path'
with open(infile, 'r') as csvfile:
rows = csv.reader(csvfile)
for row in rows:
sentence = row[0]
blob = TextBlob(sentence)
print (blob.sentiment_assessments)
【问题讨论】:
标签: python stop-words textblob