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

Method get_examples

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

Source from the content-addressed store, hash-verified

159 self.labels = ["negative", "positive"]
160
161 def get_examples(self, data_dir, split):
162 examples = []
163 label_file = open(os.path.join(data_dir, "{}_labels.txt".format(split)), 'r')
164 labels = [int(x.strip()) for x in label_file.readlines()]
165 with open(os.path.join(data_dir, '{}.txt'.format(split)),'r') as fin:
166 for idx, line in enumerate(fin):
167 text_a = line.strip()
168 example = InputExample(guid=str(idx), text_a=text_a, label=int(labels[idx]))
169 examples.append(example)
170 return examples
171
172
173 @staticmethod

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected