Idrizorg commited on
Commit
2591e22
1 Parent(s): df3a385

Update WER_Evaluation_For_TTS.py

Browse files
Files changed (1) hide show
  1. WER_Evaluation_For_TTS.py +12 -5
WER_Evaluation_For_TTS.py CHANGED
@@ -47,7 +47,7 @@ class SOMOS(datasets.GeneratorBasedBuilder):
47
  "text": datasets.Value("string"),
48
  }
49
  ),
50
- supervised_keys=("file", "text"),
51
  homepage=_URL,
52
  citation=_CITATION,
53
  )
@@ -65,14 +65,21 @@ class SOMOS(datasets.GeneratorBasedBuilder):
65
 
66
  def _generate_examples(self, wav_path, csv_path):
67
  """Generate examples from an data archive_path."""
 
 
68
 
69
  with open(csv_path, encoding="utf-8") as csv_file:
70
  csv_reader = csv.reader(csv_file)
71
  for row in csv_reader:
72
  filename = row
73
- example = {
74
- "file": filename[0],
75
- "audio": filename[0],
76
  "text": filename[1],
77
  }
78
- yield filename, example
 
 
 
 
 
 
47
  "text": datasets.Value("string"),
48
  }
49
  ),
50
+ supervised_keys=None,
51
  homepage=_URL,
52
  citation=_CITATION,
53
  )
 
65
 
66
  def _generate_examples(self, wav_path, csv_path):
67
  """Generate examples from an data archive_path."""
68
+ examples = {}
69
+ key = 0
70
 
71
  with open(csv_path, encoding="utf-8") as csv_file:
72
  csv_reader = csv.reader(csv_file)
73
  for row in csv_reader:
74
  filename = row
75
+ examples[filename[0]] = {
76
+ "file": str(filename[0]),
77
+ "audio": str(filename[0]),
78
  "text": filename[1],
79
  }
80
+ yield filename, example
81
+
82
+ for example in examples:
83
+ yield key, {**example}
84
+ key += 1
85
+ examples = []