| 45 | |
| 46 | |
| 47 | class MnlimmProcessor(DataProcessor): |
| 48 | # TODO Test needed |
| 49 | dataset_project = {"train": "train", |
| 50 | "dev": "train", |
| 51 | "test": "dev_mismatched" |
| 52 | } |
| 53 | def __init__(self): |
| 54 | super().__init__() |
| 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 | |
| 73 | class MnlimProcessor(DataProcessor): |
| 74 | # TODO Test needed |
nothing calls this directly
no outgoing calls
no test coverage detected