Long-Context-Data-Engineering
Long-Context-Data-Engineering copied to clipboard
【有个奇怪的问题】如果pred = expect_answer, 按照作者给的metric计算出来的分数不等于1
很奇怪,我觉得是不是哪里出了问题?
expected_answer = "eat a sandwich and sit in Dolores Park on a sunny day.".lower().split() model_response = "eat a sandwich and sit in Dolores Park on a sunny day.".lower() score = len(set(model_response.split()).intersection(set(expected_answer))) / len(expected_answer) print(score)
可能改成 score = len(set(model_response.split()).intersection(set(expected_answer))) / len(set(expected_answer)) ?