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

Method parse_answer

test/general/lm_eval/tasks/drop.py:102–112  ·  view source on GitHub ↗
(cls, answer)

Source from the content-addressed store, hash-verified

100
101 @classmethod
102 def parse_answer(cls, answer):
103 # NOTE: Everything is returned as a tuple for uniformity and hashability.
104 if answer["number"] != "":
105 return (str(answer["number"]),)
106 if answer["spans"] != []:
107 return tuple(answer["spans"])
108 return (
109 " ".join(
110 [answer["date"]["day"], answer["date"]["month"], answer["date"]["year"]]
111 ).strip(),
112 )
113
114 def doc_to_text(self, doc):
115 return f"Passage: {doc['passage']}\nQuestion: {doc['question']}\nAnswer:"

Callers 1

get_answersMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected