Commit
·
af7ea2a
1
Parent(s):
2c69227
Update KAMEL.py
Browse files
KAMEL.py
CHANGED
|
@@ -100,22 +100,22 @@ class Kamel(datasets.GeneratorBasedBuilder):
|
|
| 100 |
datasets.SplitGenerator(
|
| 101 |
name=datasets.Split.TRAIN,
|
| 102 |
gen_kwargs={
|
| 103 |
-
"filepath":
|
| 104 |
-
"split":
|
| 105 |
},
|
| 106 |
),
|
| 107 |
datasets.SplitGenerator(
|
| 108 |
name=datasets.Split.VALIDATION,
|
| 109 |
gen_kwargs={
|
| 110 |
-
"filepath":
|
| 111 |
-
"split":
|
| 112 |
},
|
| 113 |
),
|
| 114 |
datasets.SplitGenerator(
|
| 115 |
name=datasets.Split.TEST,
|
| 116 |
gen_kwargs={
|
| 117 |
-
"filepath":
|
| 118 |
-
"split":
|
| 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
|
| 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 |
|