fernando-peres
commited on
Commit
·
c831d85
1
Parent(s):
593964c
resolving card bugs
Browse files- py_legislation.py +20 -26
py_legislation.py
CHANGED
|
@@ -276,16 +276,18 @@ class PYLegislation(datasets.GeneratorBasedBuilder):
|
|
| 276 |
|
| 277 |
def _split_generators(self, dl_manager):
|
| 278 |
# TODO: labeled subset has two splits
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
# root = "fernandoperes/py_legislation/"
|
| 282 |
|
| 283 |
-
|
|
|
|
| 284 |
|
| 285 |
-
|
| 286 |
-
|
|
|
|
|
|
|
|
|
|
| 287 |
|
| 288 |
-
#
|
| 289 |
# urls_to_download["unlabeled_sentences"])
|
| 290 |
|
| 291 |
# ls_train = dl_manager.download_and_extract(
|
|
@@ -294,21 +296,11 @@ class PYLegislation(datasets.GeneratorBasedBuilder):
|
|
| 294 |
# ls_test = dl_manager.download_and_extract(
|
| 295 |
# urls_to_download["labeled_sentences_test"])
|
| 296 |
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
#
|
| 301 |
-
#
|
| 302 |
-
# },
|
| 303 |
-
# ),
|
| 304 |
-
|
| 305 |
-
# datasets.SplitGenerator(
|
| 306 |
-
# name=datasets.Split.TRAIN,
|
| 307 |
-
# gen_kwargs={
|
| 308 |
-
# # downloaded_files["unlabeled_sentences"],
|
| 309 |
-
# "filepath": us_train
|
| 310 |
-
# }
|
| 311 |
-
# ),
|
| 312 |
|
| 313 |
# datasets.SplitGenerator(
|
| 314 |
# name=datasets.Split.TRAIN,
|
|
@@ -329,10 +321,12 @@ class PYLegislation(datasets.GeneratorBasedBuilder):
|
|
| 329 |
|
| 330 |
# return generators
|
| 331 |
|
| 332 |
-
return
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
|
|
|
|
|
|
| 336 |
|
| 337 |
def _generate_examples(self, filepath):
|
| 338 |
"""
|
|
|
|
| 276 |
|
| 277 |
def _split_generators(self, dl_manager):
|
| 278 |
# TODO: labeled subset has two splits
|
| 279 |
+
generators = []
|
|
|
|
|
|
|
| 280 |
|
| 281 |
+
urls_to_download = _URLS
|
| 282 |
+
# downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
| 283 |
|
| 284 |
+
for k in urls_to_download:
|
| 285 |
+
fp = dl_manager.download_and_extract(urls_to_download[k])
|
| 286 |
+
generators.append(
|
| 287 |
+
datasets.SplitGenerator(
|
| 288 |
+
name=datasets.Split.TRAIN,gen_kwargs={"filepath": fp}))
|
| 289 |
|
| 290 |
+
#us_train = dl_manager.download_and_extract(
|
| 291 |
# urls_to_download["unlabeled_sentences"])
|
| 292 |
|
| 293 |
# ls_train = dl_manager.download_and_extract(
|
|
|
|
| 296 |
# ls_test = dl_manager.download_and_extract(
|
| 297 |
# urls_to_download["labeled_sentences_test"])
|
| 298 |
|
| 299 |
+
|
| 300 |
+
|
| 301 |
+
|
| 302 |
+
#generators.append(
|
| 303 |
+
# datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": us_train}))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 304 |
|
| 305 |
# datasets.SplitGenerator(
|
| 306 |
# name=datasets.Split.TRAIN,
|
|
|
|
| 321 |
|
| 322 |
# return generators
|
| 323 |
|
| 324 |
+
return generators
|
| 325 |
+
|
| 326 |
+
# datasets.SplitGenerator(
|
| 327 |
+
# name=datasets.Split.TRAIN,
|
| 328 |
+
# gen_kwargs={"filepath": downloaded_files},
|
| 329 |
+
# )
|
| 330 |
|
| 331 |
def _generate_examples(self, filepath):
|
| 332 |
"""
|