MCPcopy Create free account
hub / github.com/OpenBMB/DecT / get_examples

Method get_examples

src/process_data.py:219–231  ·  view source on GitHub ↗
(self, data_dir, split)

Source from the content-addressed store, hash-verified

217 self.labels = ['0', '1']
218
219 def get_examples(self, data_dir, split):
220 path = os.path.join(data_dir, f"{self.dataset_project[split]}.tsv")
221 examples = []
222 with open(path, encoding='utf-8')as f:
223 lines = f.readlines()
224 for idx, line in enumerate(lines[1:]):
225 linelist = line.strip().split('\t')
226 text_a = linelist[0]
227 label = linelist[1]
228 guid = "%s-%s" % (split, idx)
229 example = InputExample(guid=guid, text_a=text_a, label=self.get_label_id(label))
230 examples.append(example)
231 return examples
232
233
234class SnliProcessor(DataProcessor):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected