davidlms commited on
Commit
10127ea
1 Parent(s): 621c49d

Update letras-carnaval-cadiz.py

Browse files
Files changed (1) hide show
  1. letras-carnaval-cadiz.py +9 -3
letras-carnaval-cadiz.py CHANGED
@@ -50,8 +50,11 @@ class CadizCarnivalDataset(GeneratorBasedBuilder):
50
  BUILDER_CONFIGS = [
51
  CadizCarnivalConfig(name="accurate", description="This part of my dataset covers accurate data"),
52
  CadizCarnivalConfig(name="midaccurate", description="This part of my dataset covers midaccurate data"),
 
53
  ]
54
 
 
 
55
  def _info(self):
56
  return datasets.DatasetInfo(
57
  description=_DESCRIPTION,
@@ -80,8 +83,11 @@ class CadizCarnivalDataset(GeneratorBasedBuilder):
80
  return [SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["accurate"]})]
81
  elif self.config.name == "midaccurate":
82
  return [SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["midaccurate"]})]
83
-
84
-
 
 
 
85
 
86
  def _generate_examples(self, filepath: str):
87
  with open(filepath, encoding="utf-8") as f:
@@ -89,4 +95,4 @@ class CadizCarnivalDataset(GeneratorBasedBuilder):
89
  for item in data:
90
  item["song_type"] = song_type_mapping.get(item["song_type"], "indefinido")
91
  item["group_type"] = group_type_mapping.get(item["group_type"], "indefinido")
92
- yield item["id"], item
 
50
  BUILDER_CONFIGS = [
51
  CadizCarnivalConfig(name="accurate", description="This part of my dataset covers accurate data"),
52
  CadizCarnivalConfig(name="midaccurate", description="This part of my dataset covers midaccurate data"),
53
+ CadizCarnivalConfig(name="all", description="This part of my dataset covers both accurate and midaccurate data"),
54
  ]
55
 
56
+ DEFAULT_CONFIG_NAME = "all"
57
+
58
  def _info(self):
59
  return datasets.DatasetInfo(
60
  description=_DESCRIPTION,
 
83
  return [SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["accurate"]})]
84
  elif self.config.name == "midaccurate":
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):
93
  with open(filepath, encoding="utf-8") as 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