(self, path: str, set_type: str)
| 1340 | return self._create_examples(data_dir, "test") |
| 1341 | |
| 1342 | def _create_examples(self, path: str, set_type: str) -> List[InputExample]: |
| 1343 | examples = [] |
| 1344 | for relation in self.relations: |
| 1345 | template = self.relation_meta[relation]['template'] |
| 1346 | with open(os.path.join(path, f"{relation}/{set_type}.jsonl")) as f: |
| 1347 | for i, line in enumerate(f): |
| 1348 | obj = json.loads(line) |
| 1349 | text = template.replace("[X]", obj["sub_label"]) |
| 1350 | guid = f"{set_type}-{relation}-{i}" |
| 1351 | example = InputExample(guid=guid, text_a=text, meta={'answer': obj['obj_label']}) |
| 1352 | examples.append(example) |
| 1353 | return examples |
| 1354 | |
| 1355 | |
| 1356 | class CLUEWSCProcessor(DataProcessor): |
no test coverage detected