Update letras-carnaval-cadiz.py
Browse files- letras-carnaval-cadiz.py +4 -4
letras-carnaval-cadiz.py
CHANGED
@@ -85,14 +85,14 @@ class CadizCarnivalDataset(GeneratorBasedBuilder):
|
|
85 |
return [SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["midaccurate"]})]
|
86 |
else: # Default is "all"
|
87 |
return [
|
88 |
-
SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["accurate"]
|
89 |
-
SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["midaccurate"]
|
90 |
]
|
91 |
|
92 |
-
def _generate_examples(self, filepath: str
|
93 |
with open(filepath, encoding="utf-8") as f:
|
94 |
data = json.load(f)
|
95 |
for item in data:
|
96 |
item["song_type"] = song_type_mapping.get(item["song_type"], "indefinido")
|
97 |
item["group_type"] = group_type_mapping.get(item["group_type"], "indefinido")
|
98 |
-
yield
|
|
|
85 |
return [SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["midaccurate"]})]
|
86 |
else: # Default is "all"
|
87 |
return [
|
88 |
+
SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["accurate"]}),
|
89 |
+
SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["midaccurate"]})
|
90 |
]
|
91 |
|
92 |
+
def _generate_examples(self, filepath: str):
|
93 |
with open(filepath, encoding="utf-8") as f:
|
94 |
data = json.load(f)
|
95 |
for item in data:
|
96 |
item["song_type"] = song_type_mapping.get(item["song_type"], "indefinido")
|
97 |
item["group_type"] = group_type_mapping.get(item["group_type"], "indefinido")
|
98 |
+
yield item["id"], item
|