fernando-peres commited on
Commit
bab7bc3
·
1 Parent(s): 98c3f82

resolving card bugs

Browse files
Files changed (1) hide show
  1. py_legislation.py +9 -8
py_legislation.py CHANGED
@@ -134,9 +134,10 @@ _metadata = {
134
  "homepage": "https://www.leyes.com.py/",
135
 
136
  "license": "apache-2.0",
 
137
 
138
- # [@] Config Names:
139
-
140
  "raw_text": {
141
  "description": textwrap.dedent("""
142
  Data extracted from the sources files (URls, PDFs and Word files) without any transformation or sentence splitter. It can be helpful because you can access the raw data extracted from the seeds (PDFs and Word files) and apply other preprocessing tasks from this point to prepare the data without returning to extract texts from source files.
@@ -215,19 +216,19 @@ class PYLegislation(datasets.GeneratorBasedBuilder):
215
  datasets.BuilderConfig(
216
  name="raw_text",
217
  version=VERSION,
218
- description=_metadata["raw_text"]["description"],
219
  ),
220
 
221
  datasets.BuilderConfig(
222
  name="unlabeled_sentences",
223
  version=VERSION,
224
- description=_metadata["unlabeled_sentences"]["description"],
225
  ),
226
 
227
  # datasets.BuilderConfig(
228
  # name="labeled_sentences",
229
  # version=VERSION,
230
- # description=_metadata["labeled_sentences"]["description"],
231
  # ),
232
  ]
233
 
@@ -242,9 +243,9 @@ class PYLegislation(datasets.GeneratorBasedBuilder):
242
  """
243
  features = None
244
  description = None
245
- if self.config.name in _metadata.keys():
246
- features = datasets.Features(_metadata[self.config.name]["features"])
247
- description =_metadata[self.config.name]["description"]
248
 
249
  # if self.config.name == "raw_text":
250
  # description = _metadata["raw_text"]["description"]
 
134
  "homepage": "https://www.leyes.com.py/",
135
 
136
  "license": "apache-2.0",
137
+ }
138
 
139
+ # [@] Config Names:
140
+ _CONFIGS = {
141
  "raw_text": {
142
  "description": textwrap.dedent("""
143
  Data extracted from the sources files (URls, PDFs and Word files) without any transformation or sentence splitter. It can be helpful because you can access the raw data extracted from the seeds (PDFs and Word files) and apply other preprocessing tasks from this point to prepare the data without returning to extract texts from source files.
 
216
  datasets.BuilderConfig(
217
  name="raw_text",
218
  version=VERSION,
219
+ description=_CONFIGS["raw_text"]["description"],
220
  ),
221
 
222
  datasets.BuilderConfig(
223
  name="unlabeled_sentences",
224
  version=VERSION,
225
+ description=_CONFIGS["unlabeled_sentences"]["description"],
226
  ),
227
 
228
  # datasets.BuilderConfig(
229
  # name="labeled_sentences",
230
  # version=VERSION,
231
+ # description=_CONFIGS["labeled_sentences"]["description"],
232
  # ),
233
  ]
234
 
 
243
  """
244
  features = None
245
  description = None
246
+ if self.config.name in _CONFIGS.keys():
247
+ features = datasets.Features(_CONFIGS[self.config.name]["features"])
248
+ description =_CONFIGS[self.config.name]["description"]
249
 
250
  # if self.config.name == "raw_text":
251
  # description = _metadata["raw_text"]["description"]