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

Method get_examples

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

Source from the content-addressed store, hash-verified

55 self.labels = ["contradiction", "entailment", "neutral"]
56
57 def get_examples(self, data_dir, split):
58 path = os.path.join(data_dir, "{}.tsv".format(self.dataset_project[split]))
59 examples = []
60 with open(path, encoding='utf8') as f:
61 reader = csv.reader(f, delimiter='\t', quoting=csv.QUOTE_NONE)
62 next(reader, None)
63 for row in reader:
64 label, headline, body = self.get_label_id(row[-1]), row[8], row[9]
65 text_a = headline.replace('\\', ' ')
66 text_b = body.replace('\\', ' ')
67 example = InputExample(
68 guid=str(0), text_a=text_a, text_b=text_b, label=label)
69 examples.append(example)
70
71 return examples
72
73class MnlimProcessor(DataProcessor):
74 # TODO Test needed

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected