fernando-peres
commited on
Commit
·
a49549e
1
Parent(s):
f6b8b29
Builder created
Browse files- py_legislation.py +28 -30
py_legislation.py
CHANGED
|
@@ -282,17 +282,17 @@ class PYLegislation(datasets.GeneratorBasedBuilder):
|
|
| 282 |
|
| 283 |
def _split_generators(self, dl_manager):
|
| 284 |
# TODO: labeled subset has two splits
|
| 285 |
-
generators = []
|
| 286 |
|
| 287 |
-
urls_to_download = _URLS
|
| 288 |
-
|
| 289 |
|
| 290 |
-
for k in urls_to_download:
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
|
| 297 |
# us_train = dl_manager.download_and_extract(
|
| 298 |
# urls_to_download["unlabeled_sentences"])
|
|
@@ -306,31 +306,29 @@ class PYLegislation(datasets.GeneratorBasedBuilder):
|
|
| 306 |
# generators.append(
|
| 307 |
# datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": us_train}))
|
| 308 |
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
# ]
|
| 325 |
|
| 326 |
# return generators
|
| 327 |
|
| 328 |
-
return
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
# gen_kwargs={"filepath": downloaded_files},
|
| 333 |
-
# )
|
| 334 |
|
| 335 |
def _generate_examples(self, filepath):
|
| 336 |
"""
|
|
|
|
| 282 |
|
| 283 |
def _split_generators(self, dl_manager):
|
| 284 |
# TODO: labeled subset has two splits
|
| 285 |
+
# generators = []
|
| 286 |
|
| 287 |
+
urls_to_download = _URLS[self.config.name]
|
| 288 |
+
filepaths = dl_manager.download_and_extract(urls_to_download)
|
| 289 |
|
| 290 |
+
# for k in urls_to_download:
|
| 291 |
+
# fp = dl_manager.download_and_extract(urls_to_download[k])
|
| 292 |
+
# print(f"***************>>>> filepath = {fp}")
|
| 293 |
+
# generators.append(
|
| 294 |
+
# datasets.SplitGenerator(
|
| 295 |
+
# name=datasets.Split.TRAIN, gen_kwargs={"filepath": fp}))
|
| 296 |
|
| 297 |
# us_train = dl_manager.download_and_extract(
|
| 298 |
# urls_to_download["unlabeled_sentences"])
|
|
|
|
| 306 |
# generators.append(
|
| 307 |
# datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": us_train}))
|
| 308 |
|
| 309 |
+
# datasets.SplitGenerator(
|
| 310 |
+
# name=datasets.Split.TRAIN,
|
| 311 |
+
# gen_kwargs={
|
| 312 |
+
# # downloaded_files["labeled_sentences_train"],
|
| 313 |
+
# "filepath": ls_train
|
| 314 |
+
# },
|
| 315 |
+
# ),
|
| 316 |
+
|
| 317 |
+
# datasets.SplitGenerator(
|
| 318 |
+
# name=datasets.Split.TEST,
|
| 319 |
+
# gen_kwargs={
|
| 320 |
+
# # downloaded_files["labeled_sentences_test"],
|
| 321 |
+
# "filepath": ls_test
|
| 322 |
+
# },
|
| 323 |
+
# )
|
| 324 |
# ]
|
| 325 |
|
| 326 |
# return generators
|
| 327 |
|
| 328 |
+
return datasets.SplitGenerator(
|
| 329 |
+
name=datasets.Split.TRAIN,
|
| 330 |
+
gen_kwargs={"filepath": filepaths},
|
| 331 |
+
)
|
|
|
|
|
|
|
| 332 |
|
| 333 |
def _generate_examples(self, filepath):
|
| 334 |
"""
|