Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions language/bert/evaluate_v1.1.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ def evaluate(dataset, predictions, max_examples=None):
if max_examples and max_examples == total:
break
for qa in paragraph["qas"]:
total += 1
if max_examples and max_examples == total:
break

if qa["id"] not in predictions:
message = (
"Unanswered question " +
Expand All @@ -94,6 +90,9 @@ def evaluate(dataset, predictions, max_examples=None):
)
f1 += metric_max_over_ground_truths(
f1_score, prediction, ground_truths)
total += 1
if max_examples and max_examples == total:
break

exact_match = 100.0 * exact_match / total
f1 = 100.0 * f1 / total
Expand Down