MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / exact_match

Function exact_match

test/general/lm_eval/tasks/mc_taco.py:121–130  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

119
120
121def 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
133def f1(items):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected