我已经在python中定义了一个函数,用于从sentiwordnet获取情感评分并传递POS标记的数据,如下所示:
def Sentimentscore_Predictor(tagged):
posscore = 0
negscore = 0
for word in tagged:
synst = swn.senti_synsets(word, pos)
posscore = posscore + synst.pos_score()
negscore = negscore + synst.neg_score()
print(posscore)
print(negscore)
但是它给我一个错误:
(AttributeError:“ list”对象没有属性“ lower”)
如何从传递的标记数据中分离单词和标记并找到同义词集?