marveleverthard commited on
Commit
524c456
·
verified ·
1 Parent(s): f095651

Update jv_id_asr_split.py

Browse files
Files changed (1) hide show
  1. jv_id_asr_split.py +3 -9
jv_id_asr_split.py CHANGED
@@ -117,11 +117,6 @@ class JvIdASR(datasets.GeneratorBasedBuilder):
117
  dev_path = dl_manager.download_and_extract(_URLs["jv_id_asr_dev"])
118
  test_path = dl_manager.download_and_extract(_URLs["jv_id_asr_test"])
119
 
120
- # Logging for checking the extracted directories
121
- print(f"Contents of train path: {os.listdir(train_path)}")
122
- print(f"Contents of validation path: {os.listdir(dev_path)}")
123
- print(f"Contents of test path: {os.listdir(test_path)}")
124
-
125
  return [
126
  datasets.SplitGenerator(
127
  name=datasets.Split.TRAIN,
@@ -140,12 +135,11 @@ class JvIdASR(datasets.GeneratorBasedBuilder):
140
  def _generate_examples(self, filepath: str):
141
  print(f"Checking filepath: {filepath}")
142
  tsv_file = os.path.join(filepath, "asr_javanese", "utt_spk_text.tsv")
143
- print(f"Looking for TSV file: {tsv_file}")
144
  with open(tsv_file, "r") as f:
145
- tsv_reader = csv.reader(f, delimiter="\t")
146
- for line in tsv_reader:
147
  audio_id, sp_id, text = line[0], line[1], line[2]
148
- wav_path = os.path.join(filepath, "asr_javanese", "data", "{}".format(audio_id[:2]), "{}.flac".format(audio_id))
149
 
150
  if os.path.exists(wav_path):
151
  if self.config.schema == "source":
 
117
  dev_path = dl_manager.download_and_extract(_URLs["jv_id_asr_dev"])
118
  test_path = dl_manager.download_and_extract(_URLs["jv_id_asr_test"])
119
 
 
 
 
 
 
120
  return [
121
  datasets.SplitGenerator(
122
  name=datasets.Split.TRAIN,
 
135
  def _generate_examples(self, filepath: str):
136
  print(f"Checking filepath: {filepath}")
137
  tsv_file = os.path.join(filepath, "asr_javanese", "utt_spk_text.tsv")
 
138
  with open(tsv_file, "r") as f:
139
+ tsv_file = csv.reader(f, delimiter="\t")
140
+ for line in tsv_file:
141
  audio_id, sp_id, text = line[0], line[1], line[2]
142
+ wav_path = os.path.join(filepath, "asr_javanese", "data", "{}.flac".format(audio_id))
143
 
144
  if os.path.exists(wav_path):
145
  if self.config.schema == "source":