Spaces:
Running
Running
Update evaluation/evaluator.py
Browse files- evaluation/evaluator.py +3 -3
evaluation/evaluator.py
CHANGED
@@ -97,12 +97,12 @@ def question_scorer(prediction, gold_answer):
|
|
97 |
gold_answer, evaluator = parse_answer(answer_list)
|
98 |
prediction, run_eval = fix_prediction(prediction, gold_answer, evaluator)
|
99 |
|
100 |
-
if not run_eval:
|
101 |
-
return 0.
|
102 |
-
|
103 |
has_ans = 1.
|
104 |
if ((prediction) != float and len(prediction) == 0) or find_isnan(prediction):
|
105 |
has_ans = 0.
|
|
|
|
|
|
|
106 |
|
107 |
metric_eval = get_evaluator(evaluator)
|
108 |
accuracy = metric_eval(prediction, gold_answer)
|
|
|
97 |
gold_answer, evaluator = parse_answer(answer_list)
|
98 |
prediction, run_eval = fix_prediction(prediction, gold_answer, evaluator)
|
99 |
|
|
|
|
|
|
|
100 |
has_ans = 1.
|
101 |
if ((prediction) != float and len(prediction) == 0) or find_isnan(prediction):
|
102 |
has_ans = 0.
|
103 |
+
|
104 |
+
if not run_eval:
|
105 |
+
return 0., has_ans
|
106 |
|
107 |
metric_eval = get_evaluator(evaluator)
|
108 |
accuracy = metric_eval(prediction, gold_answer)
|