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

Method _process_doc

test/general/lm_eval/tasks/scrolls.py:336–347  ·  view source on GitHub ↗
(self, doc)

Source from the content-addressed store, hash-verified

334 return " ".join(text.split()).strip()
335
336 def _process_doc(self, doc):
337 doc = _process_doc_prepended_question(doc)
338
339 split = doc["text"].find("\n\n", doc["text"].find("(D)"))
340 choices_text = doc["text"][:split]
341
342 doc["text"] = doc["text"][split:].strip()
343 doc["choices"] = [QuALITY._normalize_answer(choice) for choice in re.split(
344 QuALITY._multiple_choice_pattern, choices_text)[1:]]
345 doc["gold"] = doc["choices"].index(QuALITY._normalize_answer(doc["outputs"][0]))
346
347 return [doc]
348
349
350class NarrativeQA(_SCROLLSTask):

Callers

nothing calls this directly

Calls 2

_normalize_answerMethod · 0.80

Tested by

no test coverage detected