fernando-peres
commited on
Commit
·
b40d816
1
Parent(s):
071902f
resolving card bugs
Browse files- py_legislation.py +23 -23
py_legislation.py
CHANGED
|
@@ -122,8 +122,8 @@ _metadata = {
|
|
| 122 |
# [>] URLS:
|
| 123 |
|
| 124 |
"urls": {
|
| 125 |
-
"raw_text": "./raw_text/train.parquet"
|
| 126 |
-
|
| 127 |
# "labeled_sentences_train": "./labeled_sentences/train.parquet",
|
| 128 |
# "labeled_sentences_test": "./labeled_sentences/test.parquet",
|
| 129 |
|
|
@@ -212,11 +212,11 @@ class PYLegislation(datasets.GeneratorBasedBuilder):
|
|
| 212 |
description=_metadata["raw_text"]["description"],
|
| 213 |
),
|
| 214 |
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
|
| 221 |
# datasets.BuilderConfig(
|
| 222 |
# name="labeled_sentences",
|
|
@@ -244,10 +244,10 @@ class PYLegislation(datasets.GeneratorBasedBuilder):
|
|
| 244 |
_metadata["raw_text"]["features"]
|
| 245 |
)
|
| 246 |
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
|
| 252 |
# if self.config.name == "labeled_sentences":
|
| 253 |
# description = _metadata["labeled_sentences"]["description"]
|
|
@@ -279,13 +279,13 @@ class PYLegislation(datasets.GeneratorBasedBuilder):
|
|
| 279 |
rt_train = dl_manager.download_and_extract(
|
| 280 |
# os.path.join(root,
|
| 281 |
# os.path.abspath(os.path.join("/src/services/worker/",_metadata["urls"]["raw_text"]))
|
| 282 |
-
|
| 283 |
# )
|
| 284 |
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
#
|
| 289 |
|
| 290 |
# ls_train = dl_manager.download_and_extract(
|
| 291 |
# # os.path.join(root,
|
|
@@ -306,13 +306,13 @@ class PYLegislation(datasets.GeneratorBasedBuilder):
|
|
| 306 |
},
|
| 307 |
),
|
| 308 |
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
|
| 317 |
# datasets.SplitGenerator(
|
| 318 |
# name=datasets.Split.TRAIN,
|
|
|
|
| 122 |
# [>] URLS:
|
| 123 |
|
| 124 |
"urls": {
|
| 125 |
+
"raw_text": "./raw_text/train.parquet",
|
| 126 |
+
"unlabeled_sentences": "./unlabeled_sentences/train.parquet",
|
| 127 |
# "labeled_sentences_train": "./labeled_sentences/train.parquet",
|
| 128 |
# "labeled_sentences_test": "./labeled_sentences/test.parquet",
|
| 129 |
|
|
|
|
| 212 |
description=_metadata["raw_text"]["description"],
|
| 213 |
),
|
| 214 |
|
| 215 |
+
datasets.BuilderConfig(
|
| 216 |
+
name="unlabeled_sentences",
|
| 217 |
+
version=VERSION,
|
| 218 |
+
description=_metadata["unlabeled_sentences"]["description"],
|
| 219 |
+
),
|
| 220 |
|
| 221 |
# datasets.BuilderConfig(
|
| 222 |
# name="labeled_sentences",
|
|
|
|
| 244 |
_metadata["raw_text"]["features"]
|
| 245 |
)
|
| 246 |
|
| 247 |
+
if self.config.name == "unlabeled_sentences":
|
| 248 |
+
description = _metadata["unlabeled_sentences"]["description"]
|
| 249 |
+
features = datasets.Features(
|
| 250 |
+
_metadata["unlabeled_sentences"]["features"])
|
| 251 |
|
| 252 |
# if self.config.name == "labeled_sentences":
|
| 253 |
# description = _metadata["labeled_sentences"]["description"]
|
|
|
|
| 279 |
rt_train = dl_manager.download_and_extract(
|
| 280 |
# os.path.join(root,
|
| 281 |
# os.path.abspath(os.path.join("/src/services/worker/",_metadata["urls"]["raw_text"]))
|
| 282 |
+
_metadata["urls"]["raw_text"])
|
| 283 |
# )
|
| 284 |
|
| 285 |
+
us_train = dl_manager.download_and_extract(
|
| 286 |
+
# os.path.join(root,
|
| 287 |
+
_metadata["urls"]["unlabeled_sentences"])
|
| 288 |
+
# )
|
| 289 |
|
| 290 |
# ls_train = dl_manager.download_and_extract(
|
| 291 |
# # os.path.join(root,
|
|
|
|
| 306 |
},
|
| 307 |
),
|
| 308 |
|
| 309 |
+
datasets.SplitGenerator(
|
| 310 |
+
name=datasets.Split.TRAIN,
|
| 311 |
+
gen_kwargs={
|
| 312 |
+
# downloaded_files["unlabeled_sentences"],
|
| 313 |
+
"filepath": us_train
|
| 314 |
+
}
|
| 315 |
+
),
|
| 316 |
|
| 317 |
# datasets.SplitGenerator(
|
| 318 |
# name=datasets.Split.TRAIN,
|