OpenCompass/opencompass/datasets/calm/evaluation/accuracy/choice.py

5 lines
163 B
Python
Raw Normal View History

def compute_acc(gt_list, pred_list):
correct_num = sum(pred == gt for gt, pred in zip(gt_list, pred_list))
acc = correct_num / len(gt_list)
return acc