(self, data_dir, split)
| 81 | self.labels = ["contradiction", "entailment", "neutral"] |
| 82 | |
| 83 | def get_examples(self, data_dir, split): |
| 84 | path = os.path.join(data_dir, "{}.tsv".format(self.dataset_project[split])) |
| 85 | examples = [] |
| 86 | with open(path, encoding='utf8') as f: |
| 87 | reader = csv.reader(f, delimiter='\t', quoting=csv.QUOTE_NONE) |
| 88 | next(reader, None) |
| 89 | for row in reader: |
| 90 | label, headline, body = self.get_label_id(row[-1]), row[8], row[9] |
| 91 | text_a = headline.replace('\\', ' ') |
| 92 | text_b = body.replace('\\', ' ') |
| 93 | example = InputExample( |
| 94 | guid=str(0), text_a=text_a, text_b=text_b, label=label) |
| 95 | examples.append(example) |
| 96 | |
| 97 | return examples |
| 98 | |
| 99 | |
| 100 | class AgnewsProcessor(DataProcessor): |
nothing calls this directly
no outgoing calls
no test coverage detected