| 1318 | class LamaProcessor(DataProcessor): |
| 1319 | |
| 1320 | def __init__(self, args): |
| 1321 | super().__init__() |
| 1322 | self.relations = ['P1001', 'P101', 'P103', 'P106', 'P108', 'P127', 'P1303', 'P131', 'P136', 'P1376', |
| 1323 | 'P138', 'P140', 'P1412', 'P159', 'P17', 'P176', 'P178', 'P19', 'P190', 'P20', 'P264', |
| 1324 | 'P27', 'P276', 'P279', 'P30', 'P31', 'P36', 'P361', 'P364', 'P37', 'P39', 'P407', |
| 1325 | 'P413', 'P449', 'P463', 'P47', 'P495', 'P527', 'P530', 'P740', 'P937'] |
| 1326 | self.relation_meta = {} |
| 1327 | with open(os.path.join(args.data_path, '../relations.jsonl')) as f: |
| 1328 | for line in f: |
| 1329 | obj = json.loads(line) |
| 1330 | if obj['relation'] in self.relations: |
| 1331 | self.relation_meta[obj['relation']] = obj |
| 1332 | |
| 1333 | def get_train_examples(self, data_dir): |
| 1334 | return self._create_examples(data_dir, "train") |