Datasets:
davebulaval
commited on
Commit
•
f53a0fa
1
Parent(s):
0e89987
Upload RISCBAC.py
Browse files- RISCBAC.py +3 -3
RISCBAC.py
CHANGED
@@ -88,21 +88,21 @@ class RISCBAC(datasets.GeneratorBasedBuilder):
|
|
88 |
return [
|
89 |
datasets.SplitGenerator(
|
90 |
name="full_en",
|
91 |
-
gen_kwargs={"filepath": os.path.join(data_dir, "en.jsonl")
|
92 |
)
|
93 |
]
|
94 |
elif self.config.name == "fr":
|
95 |
return [
|
96 |
datasets.SplitGenerator(
|
97 |
name="full_fr",
|
98 |
-
gen_kwargs={"filepath": os.path.join(data_dir, "fr.jsonl")
|
99 |
),
|
100 |
]
|
101 |
else:
|
102 |
raise ValueError(f"The config name {self.config.name} is not supported. Please use " "'en' or 'fr'.")
|
103 |
|
104 |
def _generate_examples(self, filepath, idx_key):
|
105 |
-
with open(filepath
|
106 |
for key, line in enumerate(f):
|
107 |
d = json.loads(line)
|
108 |
yield key, {"text": d}
|
|
|
88 |
return [
|
89 |
datasets.SplitGenerator(
|
90 |
name="full_en",
|
91 |
+
gen_kwargs={"filepath": os.path.join(data_dir, "en.jsonl")},
|
92 |
)
|
93 |
]
|
94 |
elif self.config.name == "fr":
|
95 |
return [
|
96 |
datasets.SplitGenerator(
|
97 |
name="full_fr",
|
98 |
+
gen_kwargs={"filepath": os.path.join(data_dir, "fr.jsonl")},
|
99 |
),
|
100 |
]
|
101 |
else:
|
102 |
raise ValueError(f"The config name {self.config.name} is not supported. Please use " "'en' or 'fr'.")
|
103 |
|
104 |
def _generate_examples(self, filepath, idx_key):
|
105 |
+
with open(filepath, "r", encoding="utf-8") as f:
|
106 |
for key, line in enumerate(f):
|
107 |
d = json.loads(line)
|
108 |
yield key, {"text": d}
|