Datasets:
Commit
·
312a362
1
Parent(s):
ba920fe
Upload riscbac.py
Browse files- riscbac.py +7 -6
riscbac.py
CHANGED
@@ -76,6 +76,7 @@ class RISCBAC(datasets.GeneratorBasedBuilder):
|
|
76 |
return datasets.DatasetInfo(
|
77 |
description=_DESCRIPTION,
|
78 |
features=features,
|
|
|
79 |
homepage=_HOMEPAGE,
|
80 |
license=_LICENSE,
|
81 |
citation=_CITATION,
|
@@ -87,25 +88,25 @@ class RISCBAC(datasets.GeneratorBasedBuilder):
|
|
87 |
if self.config.name == "en":
|
88 |
return [
|
89 |
datasets.SplitGenerator(
|
90 |
-
name=
|
91 |
gen_kwargs={
|
92 |
"filepath": os.path.join(data_dir, "en", "en.jsonl"),
|
93 |
-
"split": "full",
|
94 |
},
|
95 |
)
|
96 |
]
|
97 |
-
|
98 |
return [
|
99 |
datasets.SplitGenerator(
|
100 |
-
name=
|
101 |
gen_kwargs={
|
102 |
"filepath": os.path.join(data_dir, "fr", "fr.jsonl"),
|
103 |
-
"split": "full",
|
104 |
},
|
105 |
),
|
106 |
]
|
|
|
|
|
107 |
|
108 |
-
def _generate_examples(self, filepath
|
109 |
with open(filepath, "r", encoding="utf-8") as f:
|
110 |
for key, line in enumerate(f):
|
111 |
d = json.loads(line)
|
|
|
76 |
return datasets.DatasetInfo(
|
77 |
description=_DESCRIPTION,
|
78 |
features=features,
|
79 |
+
supervised_keys=None,
|
80 |
homepage=_HOMEPAGE,
|
81 |
license=_LICENSE,
|
82 |
citation=_CITATION,
|
|
|
88 |
if self.config.name == "en":
|
89 |
return [
|
90 |
datasets.SplitGenerator(
|
91 |
+
name="full_en",
|
92 |
gen_kwargs={
|
93 |
"filepath": os.path.join(data_dir, "en", "en.jsonl"),
|
|
|
94 |
},
|
95 |
)
|
96 |
]
|
97 |
+
elif self.config.name == "fr":
|
98 |
return [
|
99 |
datasets.SplitGenerator(
|
100 |
+
name="full_fr",
|
101 |
gen_kwargs={
|
102 |
"filepath": os.path.join(data_dir, "fr", "fr.jsonl"),
|
|
|
103 |
},
|
104 |
),
|
105 |
]
|
106 |
+
else:
|
107 |
+
raise ValueError(f"The config name {self.config.name} is not supported. Please use " "'en' or 'fr'.")
|
108 |
|
109 |
+
def _generate_examples(self, filepath):
|
110 |
with open(filepath, "r", encoding="utf-8") as f:
|
111 |
for key, line in enumerate(f):
|
112 |
d = json.loads(line)
|