Datasets:
Commit
·
ba920fe
1
Parent(s):
8026157
Upload riscbac.py
Browse files- riscbac.py +7 -8
riscbac.py
CHANGED
|
@@ -89,7 +89,7 @@ class RISCBAC(datasets.GeneratorBasedBuilder):
|
|
| 89 |
datasets.SplitGenerator(
|
| 90 |
name=datasets.Split.TRAIN,
|
| 91 |
gen_kwargs={
|
| 92 |
-
"
|
| 93 |
"split": "full",
|
| 94 |
},
|
| 95 |
)
|
|
@@ -99,15 +99,14 @@ class RISCBAC(datasets.GeneratorBasedBuilder):
|
|
| 99 |
datasets.SplitGenerator(
|
| 100 |
name=datasets.Split.TRAIN,
|
| 101 |
gen_kwargs={
|
| 102 |
-
"
|
| 103 |
"split": "full",
|
| 104 |
},
|
| 105 |
),
|
| 106 |
]
|
| 107 |
|
| 108 |
-
def _generate_examples(self,
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
yield key, {"text": text}
|
|
|
|
| 89 |
datasets.SplitGenerator(
|
| 90 |
name=datasets.Split.TRAIN,
|
| 91 |
gen_kwargs={
|
| 92 |
+
"filepath": os.path.join(data_dir, "en", "en.jsonl"),
|
| 93 |
"split": "full",
|
| 94 |
},
|
| 95 |
)
|
|
|
|
| 99 |
datasets.SplitGenerator(
|
| 100 |
name=datasets.Split.TRAIN,
|
| 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, split):
|
| 109 |
+
with open(filepath, "r", encoding="utf-8") as f:
|
| 110 |
+
for key, line in enumerate(f):
|
| 111 |
+
d = json.loads(line)
|
| 112 |
+
yield key, {"text": d}
|
|
|