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

Method doc_to_text

test/general/lm_eval/tasks/race.py:105–117  ·  view source on GitHub ↗
(self, doc)

Source from the content-addressed store, hash-verified

103 return doc["problems"][-1]
104
105 def doc_to_text(self, doc):
106 text = "Article: " + doc["article"] + "\n\n"
107 for problem in doc["problems"][:-1]:
108 if problem["question"][-6:] == " _ .":
109 text += (
110 problem["question"][-5:] + self.get_answer_option(problem) + "\n"
111 )
112 else:
113 question = "Question: " + problem["question"] + "\n"
114 answer = "Answer: " + self.get_answer_option(problem) + "\n"
115 text += question + answer
116 text += self.last_problem(doc)["question"]
117 return text
118
119 def should_decontaminate(self):
120 return True

Callers

nothing calls this directly

Calls 2

get_answer_optionMethod · 0.95
last_problemMethod · 0.95

Tested by

no test coverage detected