davidlms commited on
Commit
69d34b7
1 Parent(s): 03854a8

Update letras-carnaval-cadiz.py

Browse files
Files changed (1) hide show
  1. 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"], "prefix": "accurate"}),
89
- SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["midaccurate"], "prefix": "midaccurate"})
90
  ]
91
 
92
- def _generate_examples(self, filepath: str, prefix: 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 prefix + "_" + item["id"], item
 
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