LeandraFichtel
commited on
Commit
•
e377a0c
1
Parent(s):
a162891
Update KAMEL.py
Browse files
KAMEL.py
CHANGED
@@ -74,7 +74,6 @@ class Kamel(datasets.GeneratorBasedBuilder):
|
|
74 |
features = datasets.Features(
|
75 |
{
|
76 |
"index": datasets.Value("string"),
|
77 |
-
"relation_id": datasets.Value("string"),
|
78 |
"obj_uri": datasets.Value("string"),
|
79 |
"obj_label": datasets.Value("string"),
|
80 |
"sub_label": datasets.Value("string")
|
@@ -94,8 +93,7 @@ class Kamel(datasets.GeneratorBasedBuilder):
|
|
94 |
# TODO The generator class is not working!
|
95 |
def _split_generators(self, dl_manager):
|
96 |
dl_dir = dl_manager.download_and_extract(_DATA_URL)
|
97 |
-
|
98 |
-
|
99 |
return [
|
100 |
datasets.SplitGenerator(
|
101 |
name=datasets.Split.TRAIN,
|
@@ -124,11 +122,6 @@ class Kamel(datasets.GeneratorBasedBuilder):
|
|
124 |
id_ = -1
|
125 |
"""Yields examples from the KAMEL dataset."""
|
126 |
|
127 |
-
#templates = {}
|
128 |
-
#with open(os.path.join(filepath, "templates.jsonl"), encoding="utf-8") as fp:
|
129 |
-
# for line in fp:
|
130 |
-
# line = json.loads(line)
|
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:
|
|
|
74 |
features = datasets.Features(
|
75 |
{
|
76 |
"index": datasets.Value("string"),
|
|
|
77 |
"obj_uri": datasets.Value("string"),
|
78 |
"obj_label": datasets.Value("string"),
|
79 |
"sub_label": datasets.Value("string")
|
|
|
93 |
# TODO The generator class is not working!
|
94 |
def _split_generators(self, dl_manager):
|
95 |
dl_dir = dl_manager.download_and_extract(_DATA_URL)
|
96 |
+
|
|
|
97 |
return [
|
98 |
datasets.SplitGenerator(
|
99 |
name=datasets.Split.TRAIN,
|
|
|
122 |
id_ = -1
|
123 |
"""Yields examples from the KAMEL dataset."""
|
124 |
|
|
|
|
|
|
|
|
|
|
|
125 |
for relation in self.config.relations:
|
126 |
# load triples
|
127 |
with open(os.path.join(filepath, relation, f"{split}.jsonl"), encoding="utf-8") as fp:
|