Counts a question as correct if the model accurately classifies the plausibility of an answer for all candidate answers. See section 4 "Evaluation Metrics" in the paper.
(items)
| 119 | |
| 120 | |
| 121 | def exact_match(items): |
| 122 | """ |
| 123 | Counts a question as correct if the model accurately classifies the plausibility |
| 124 | of an answer for all candidate answers. See section 4 "Evaluation Metrics" in the paper. |
| 125 | """ |
| 126 | results = list(zip(*items)) |
| 127 | accuracies = defaultdict(list) |
| 128 | for gold, pred, question in zip(results[0], results[1], results[2]): |
| 129 | accuracies[question].append(pred == gold) |
| 130 | return np.mean([int(all(accs)) for accs in accuracies.values()]) |
| 131 | |
| 132 | |
| 133 | def f1(items): |
nothing calls this directly
no outgoing calls
no test coverage detected