| 280 | |
| 281 | |
| 282 | class RteProcessor(DataProcessor): |
| 283 | dataset_project = {"train": "train", |
| 284 | "dev": "train", |
| 285 | "test": "dev" |
| 286 | } |
| 287 | def __init__(self): |
| 288 | super().__init__() |
| 289 | self.labels = ["not_entailment", "entailment"] |
| 290 | |
| 291 | def get_examples(self, data_dir, split): |
| 292 | path = os.path.join(data_dir, "{}.tsv".format(self.dataset_project[split])) |
| 293 | examples = [] |
| 294 | with open(path)as f: |
| 295 | lines = f.readlines() |
| 296 | for idx, line in enumerate(lines[1:]): |
| 297 | line_list = line.strip().split('\t') |
| 298 | text_a = line_list[-3] |
| 299 | text_b = line_list[-2] |
| 300 | label = self.get_label_id(line_list[-1]) |
| 301 | example = InputExample( |
| 302 | guid=str(idx), text_a=text_a, text_b=text_b, label=label) |
| 303 | examples.append(example) |
| 304 | return examples |
| 305 | |
| 306 | class FewNERDProcessor(DataProcessor): |
| 307 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected