LeandraFichtel commited on
Commit
af7ea2a
1 Parent(s): 2c69227

Update KAMEL.py

Browse files
Files changed (1) hide show
  1. KAMEL.py +7 -8
KAMEL.py CHANGED
@@ -100,22 +100,22 @@ class Kamel(datasets.GeneratorBasedBuilder):
100
  datasets.SplitGenerator(
101
  name=datasets.Split.TRAIN,
102
  gen_kwargs={
103
- "filepath": os.path.join(dl_dir, "RELATION", "train.jsonl"),
104
- "split": datasets.Split.TRAIN,
105
  },
106
  ),
107
  datasets.SplitGenerator(
108
  name=datasets.Split.VALIDATION,
109
  gen_kwargs={
110
- "filepath": os.path.join(dl_dir, "RELATION", "dev.jsonl"),
111
- "split": datasets.Split.VALIDATION,
112
  },
113
  ),
114
  datasets.SplitGenerator(
115
  name=datasets.Split.TEST,
116
  gen_kwargs={
117
- "filepath": os.path.join(dl_dir, "RELATION", "test.jsonl"),
118
- "split": datasets.Split.TEST,
119
  },
120
  ),
121
  ]
@@ -131,8 +131,7 @@ class Kamel(datasets.GeneratorBasedBuilder):
131
  # templates[line["relation"]] = line["template"]
132
  for relation in self.config.relations:
133
  # load triples
134
- filepath = filepath.replace("RELATION", relation)
135
- with open(os.path.join(filepath, f"{split}.jsonl"), encoding="utf-8") as fp:
136
  for line in fp:
137
  triple = json.loads(line)
138
 
 
100
  datasets.SplitGenerator(
101
  name=datasets.Split.TRAIN,
102
  gen_kwargs={
103
+ "filepath": dl_dir,
104
+ "split": "train",
105
  },
106
  ),
107
  datasets.SplitGenerator(
108
  name=datasets.Split.VALIDATION,
109
  gen_kwargs={
110
+ "filepath": dl_dir,
111
+ "split": "dev",
112
  },
113
  ),
114
  datasets.SplitGenerator(
115
  name=datasets.Split.TEST,
116
  gen_kwargs={
117
+ "filepath": dl_dir,
118
+ "split": "test",
119
  },
120
  ),
121
  ]
 
131
  # templates[line["relation"]] = line["template"]
132
  for relation in self.config.relations:
133
  # load triples
134
+ with open(os.path.join(filepath, relation, f"{split}.jsonl"), encoding="utf-8") as fp:
 
135
  for line in fp:
136
  triple = json.loads(line)
137