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

Method _answer_to_bags

test/general/lm_eval/tasks/drop.py:183–194  ·  view source on GitHub ↗
(self, answer)

Source from the content-addressed store, hash-verified

181 return exact_match, f1
182
183 def _answer_to_bags(self, answer):
184 if isinstance(answer, (list, tuple)):
185 raw_spans = answer
186 else:
187 raw_spans = [answer]
188 normalized_spans = []
189 token_bags = []
190 for raw_span in raw_spans:
191 normalized_span = self._normalize(raw_span)
192 normalized_spans.append(normalized_span)
193 token_bags.append(set(normalized_span.split()))
194 return normalized_spans, token_bags
195
196 def _align_bags(self, predicted, gold):
197 """

Callers 1

get_metricsMethod · 0.95

Calls 1

_normalizeMethod · 0.95

Tested by

no test coverage detected