Datasets:
fix dataset loading script
Browse files
d3fend.py
CHANGED
@@ -24,18 +24,14 @@ class D3FENDDatasetBuilder(GeneratorBasedBuilder):
|
|
24 |
|
25 |
def _split_generators(self, dl_manager):
|
26 |
# Download and extract the dataset
|
27 |
-
|
28 |
-
|
29 |
return [SplitGenerator(name=datasets.Split.TRAIN,
|
30 |
-
gen_kwargs={'filepath':
|
31 |
|
32 |
def _generate_examples(self, filepath):
|
33 |
id_ = 0
|
34 |
graph = Graph(bind_namespaces="core")
|
35 |
-
graph.bind("d3f", D3F)
|
36 |
-
graph.bind("dcterms", DCTERMS)
|
37 |
-
graph.bind("skos", SKOS)
|
38 |
-
graph.bind("dcam", DCAM)
|
39 |
graph.parse(filepath)
|
40 |
# Yield individual triples from the graph as N3
|
41 |
for (s, p, o) in graph.triples((None, None, None)):
|
|
|
24 |
|
25 |
def _split_generators(self, dl_manager):
|
26 |
# Download and extract the dataset
|
27 |
+
extracted = dl_manager.download_and_extract("d3fend.nt.gz")
|
28 |
+
|
29 |
return [SplitGenerator(name=datasets.Split.TRAIN,
|
30 |
+
gen_kwargs={'filepath': extracted})]
|
31 |
|
32 |
def _generate_examples(self, filepath):
|
33 |
id_ = 0
|
34 |
graph = Graph(bind_namespaces="core")
|
|
|
|
|
|
|
|
|
35 |
graph.parse(filepath)
|
36 |
# Yield individual triples from the graph as N3
|
37 |
for (s, p, o) in graph.triples((None, None, None)):
|