jkot commited on
Commit
9ec223c
1 Parent(s): 799ce12

Update czech_parliament_plenary_hearings.py

Browse files
czech_parliament_plenary_hearings.py CHANGED
@@ -40,6 +40,7 @@ class CzechParliamentPlenaryHearings(GeneratorBasedBuilder):
40
  citation=_CITATION,
41
  license=_LICENSE
42
  )
 
43
  def _split_generators(self, dl_manager):
44
  archive_path = dl_manager.download(_DATASET_URL)
45
  data_dir = os.path.join(archive_path, 'ASR_DATA')
@@ -53,8 +54,9 @@ class CzechParliamentPlenaryHearings(GeneratorBasedBuilder):
53
  split_generators = []
54
  for split in splits:
55
  split_generators.append(
56
- name=split_names.get(split, split),
57
- gen_kwargs={'split': split, 'data_dir': data_dir}
 
58
  )
59
  return split_generators
60
 
@@ -70,12 +72,13 @@ class CzechParliamentPlenaryHearings(GeneratorBasedBuilder):
70
  elif file_name.endswith('.wav'):
71
  with self._dl_manager.iter_archive(archive_path, filter_func=lambda x: x.path == file_path) as files:
72
  audio_file = next(files)
73
- audio_path = os.path.join(folder_name, audio_file.path.split('/')[-1])
 
74
  audio, sr = librosa.load(audio_file, sr=16000)
75
 
76
  yield f'{folder_name}/{audio_file.path.split("/")[-1]}', {
77
  'audio': {
78
- 'path': audio_path, 'bytes': audio
79
- },
80
  'transcription': transcription,
81
- }
 
40
  citation=_CITATION,
41
  license=_LICENSE
42
  )
43
+
44
  def _split_generators(self, dl_manager):
45
  archive_path = dl_manager.download(_DATASET_URL)
46
  data_dir = os.path.join(archive_path, 'ASR_DATA')
 
54
  split_generators = []
55
  for split in splits:
56
  split_generators.append(
57
+ datasets.SplitGenerator(
58
+ name=split_names.get(split, split),
59
+ gen_kwargs={'split': split, 'data_dir': data_dir})
60
  )
61
  return split_generators
62
 
 
72
  elif file_name.endswith('.wav'):
73
  with self._dl_manager.iter_archive(archive_path, filter_func=lambda x: x.path == file_path) as files:
74
  audio_file = next(files)
75
+ audio_path = os.path.join(
76
+ folder_name, audio_file.path.split('/')[-1])
77
  audio, sr = librosa.load(audio_file, sr=16000)
78
 
79
  yield f'{folder_name}/{audio_file.path.split("/")[-1]}', {
80
  'audio': {
81
+ 'path': audio_path, 'bytes': audio
82
+ },
83
  'transcription': transcription,
84
+ }