cahya commited on
Commit
f38ed63
1 Parent(s): b2cb7cb

cosmetics change

Browse files
Files changed (1) hide show
  1. librivox-indonesia.py +6 -7
librivox-indonesia.py CHANGED
@@ -30,7 +30,7 @@ _HOMEPAGE = "https://huggingface.co/indonesian-nlp/librivox-indonesia"
30
 
31
  _LICENSE = "https://creativecommons.org/publicdomain/zero/1.0/"
32
 
33
- _DATA_URL = "https://huggingface.co/datasets/cahya/librivox-indonesia/resolve/main/data"
34
 
35
 
36
  class LibriVoxIndonesiaConfig(datasets.BuilderConfig):
@@ -41,13 +41,12 @@ class LibriVoxIndonesiaConfig(datasets.BuilderConfig):
41
  self.release_date = kwargs.pop("release_date", None)
42
  self.num_clips = kwargs.pop("num_clips", None)
43
  self.num_speakers = kwargs.pop("num_speakers", None)
44
- self.validated_hr = kwargs.pop("validated_hr", None)
45
  self.total_hr = kwargs.pop("total_hr", None)
46
  self.size_bytes = kwargs.pop("size_bytes", None)
47
  self.size_human = size_str(self.size_bytes)
48
  description = (
49
  f"LibriVox-Indonesia speech to text dataset in {self.language} released on {self.release_date}. "
50
- f"The dataset comprises {self.validated_hr} hours of transcribed speech data"
51
  )
52
  super(LibriVoxIndonesiaConfig, self).__init__(
53
  name=name,
@@ -105,13 +104,13 @@ class LibriVoxIndonesia(datasets.GeneratorBasedBuilder):
105
  def _split_generators(self, dl_manager):
106
  """Returns SplitGenerators."""
107
  dl_manager.download_config.ignore_url_params = True
108
- audio = {}
109
  local_extracted_archive = {}
110
  metadata_path = {}
111
  split_type = {"train": datasets.Split.TRAIN, "test": datasets.Split.TEST}
112
  for split in split_type:
113
- audio[split] = dl_manager.download(f"{_DATA_URL}/audio_{split}.tgz")
114
- local_extracted_archive[split] = dl_manager.extract(audio[split]) if not dl_manager.is_streaming else None
115
  metadata_path[split] = dl_manager.download_and_extract(f"{_DATA_URL}/metadata_{split}.csv.gz")
116
  path_to_clips = "librivox-indonesia"
117
 
@@ -120,7 +119,7 @@ class LibriVoxIndonesia(datasets.GeneratorBasedBuilder):
120
  name=split_type[split],
121
  gen_kwargs={
122
  "local_extracted_archive": local_extracted_archive[split],
123
- "audio_files": dl_manager.iter_archive(audio[split]),
124
  "metadata_path": dl_manager.download_and_extract(metadata_path[split]),
125
  "path_to_clips": path_to_clips,
126
  },
 
30
 
31
  _LICENSE = "https://creativecommons.org/publicdomain/zero/1.0/"
32
 
33
+ _DATA_URL = "https://huggingface.co/datasets/indonesian-nlp/librivox-indonesia/resolve/main/data"
34
 
35
 
36
  class LibriVoxIndonesiaConfig(datasets.BuilderConfig):
 
41
  self.release_date = kwargs.pop("release_date", None)
42
  self.num_clips = kwargs.pop("num_clips", None)
43
  self.num_speakers = kwargs.pop("num_speakers", None)
 
44
  self.total_hr = kwargs.pop("total_hr", None)
45
  self.size_bytes = kwargs.pop("size_bytes", None)
46
  self.size_human = size_str(self.size_bytes)
47
  description = (
48
  f"LibriVox-Indonesia speech to text dataset in {self.language} released on {self.release_date}. "
49
+ f"The dataset comprises {self.total_hr} hours of transcribed speech data"
50
  )
51
  super(LibriVoxIndonesiaConfig, self).__init__(
52
  name=name,
 
104
  def _split_generators(self, dl_manager):
105
  """Returns SplitGenerators."""
106
  dl_manager.download_config.ignore_url_params = True
107
+ audio_path = {}
108
  local_extracted_archive = {}
109
  metadata_path = {}
110
  split_type = {"train": datasets.Split.TRAIN, "test": datasets.Split.TEST}
111
  for split in split_type:
112
+ audio_path[split] = dl_manager.download(f"{_DATA_URL}/audio_{split}.tgz")
113
+ local_extracted_archive[split] = dl_manager.extract(audio_path[split]) if not dl_manager.is_streaming else None
114
  metadata_path[split] = dl_manager.download_and_extract(f"{_DATA_URL}/metadata_{split}.csv.gz")
115
  path_to_clips = "librivox-indonesia"
116
 
 
119
  name=split_type[split],
120
  gen_kwargs={
121
  "local_extracted_archive": local_extracted_archive[split],
122
+ "audio_files": dl_manager.iter_archive(audio_path[split]),
123
  "metadata_path": dl_manager.download_and_extract(metadata_path[split]),
124
  "path_to_clips": path_to_clips,
125
  },