def acc(preds,scores):
golds = []
for n,i in enumerate(scores):
p = -1
i=i.strip()
if i == "CONTRADICTION":
p = 0
elif i == "NEUTRAL":
p = 1
elif i == "ENTAILMENT":
p = 2
else:
raise ValueError('Something wrong with data...')
golds.append(p)
#print confusion_matrix(golds,preds)
return accuracy_score(golds,preds)
评论列表
文章目录