fernando-peres
commited on
Commit
·
bc29eb8
1
Parent(s):
7741672
resolving card bugs
Browse files- py_legislation.py +29 -36
py_legislation.py
CHANGED
|
@@ -236,30 +236,23 @@ class PY_legislation(datasets.GeneratorBasedBuilder):
|
|
| 236 |
if self.config.name == "raw_text":
|
| 237 |
description = _metadata["raw_text"]["description"]
|
| 238 |
features = datasets.Features(
|
| 239 |
-
|
| 240 |
-
"source_id": datasets.Value(dtype="int64"),
|
| 241 |
-
"source_name": datasets.Value(dtype="string"),
|
| 242 |
-
"text_id": datasets.Value(dtype="int64"),
|
| 243 |
-
"text": datasets.Value(dtype="string"),
|
| 244 |
-
"extension": datasets.Sequence(
|
| 245 |
-
datasets.ClassLabel(names=["docx", "pdf", "html", "txt", "doc"],)),
|
| 246 |
-
}
|
| 247 |
)
|
| 248 |
|
| 249 |
-
if self.config.name == "unlabeled_sentences":
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
|
| 254 |
-
if self.config.name == "labeled_sentences":
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
|
| 259 |
-
else:
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
|
| 264 |
return datasets.DatasetInfo(
|
| 265 |
description=description,
|
|
@@ -281,22 +274,22 @@ class PY_legislation(datasets.GeneratorBasedBuilder):
|
|
| 281 |
gen_kwargs={"filepath": downloaded_files["raw_text"]},
|
| 282 |
),
|
| 283 |
|
| 284 |
-
datasets.SplitGenerator(
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
),
|
| 289 |
-
|
| 290 |
-
datasets.SplitGenerator(
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
),
|
| 294 |
-
|
| 295 |
-
datasets.SplitGenerator(
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
)
|
| 300 |
]
|
| 301 |
|
| 302 |
return generators
|
|
|
|
| 236 |
if self.config.name == "raw_text":
|
| 237 |
description = _metadata["raw_text"]["description"]
|
| 238 |
features = datasets.Features(
|
| 239 |
+
_metadata["raw_text"]["description"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
)
|
| 241 |
|
| 242 |
+
# if self.config.name == "unlabeled_sentences":
|
| 243 |
+
# description = _metadata["unlabeled_sentences"]["description"]
|
| 244 |
+
# features = datasets.Features(
|
| 245 |
+
# _metadata["unlabeled_sentences"]["features"])
|
| 246 |
|
| 247 |
+
# if self.config.name == "labeled_sentences":
|
| 248 |
+
# description = _metadata["labeled_sentences"]["description"]
|
| 249 |
+
# features = datasets.Features(
|
| 250 |
+
# _metadata["labeled_sentences"]["features"])
|
| 251 |
|
| 252 |
+
# else:
|
| 253 |
+
# features = datasets.Features(
|
| 254 |
+
# _metadata["raw_text"]["description"]
|
| 255 |
+
# )
|
| 256 |
|
| 257 |
return datasets.DatasetInfo(
|
| 258 |
description=description,
|
|
|
|
| 274 |
gen_kwargs={"filepath": downloaded_files["raw_text"]},
|
| 275 |
),
|
| 276 |
|
| 277 |
+
# datasets.SplitGenerator(
|
| 278 |
+
# name=datasets.Split.TRAIN,
|
| 279 |
+
# gen_kwargs={
|
| 280 |
+
# "filepath": downloaded_files["unlabeled_sentences"]},
|
| 281 |
+
# ),
|
| 282 |
+
|
| 283 |
+
# datasets.SplitGenerator(
|
| 284 |
+
# name=datasets.Split.TRAIN,
|
| 285 |
+
# gen_kwargs={"filepath": downloaded_files["labeled_sentences"]},
|
| 286 |
+
# ),
|
| 287 |
+
|
| 288 |
+
# datasets.SplitGenerator(
|
| 289 |
+
# name=datasets.Split.TEST,
|
| 290 |
+
# gen_kwargs={
|
| 291 |
+
# "filepath": downloaded_files["labeled_sentences"]},
|
| 292 |
+
# )
|
| 293 |
]
|
| 294 |
|
| 295 |
return generators
|