MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / get_data

Method get_data

AgentBench.old/src/tasks/knowledgegraph/task.py:177–187  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

175 }
176
177 def get_data(self):
178 data = Dataset()
179 with open(self.data_fn, "r") as f:
180 data_object = json.load(f)
181 for item in data_object:
182 answer = item.pop("answer")
183 gold_answer = set()
184 for a in answer:
185 gold_answer.add(a["answer_argument"])
186 data.append(DataPiece(item, gold_answer)) # input and target
187 return data
188
189 def predict_single(self, session, data_item): # return OUTPUT object, need to be json serializable
190 # todo: return a dictionary including the prediction and metrics per data item

Callers

nothing calls this directly

Calls 4

DatasetClass · 0.90
DataPieceClass · 0.90
loadMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected