mnazari commited on
Commit
fe8f1e0
1 Parent(s): c98b9e5
Files changed (3) hide show
  1. README.md +1 -0
  2. _common_voice.py +19 -2
  3. nena_speech_1_0.py +6 -4
README.md CHANGED
@@ -2,6 +2,7 @@
2
  pretty_name: NENA Speech Dataset 1.0 (test)
3
  language:
4
  - aii
 
5
  annotations_creators:
6
  - crowdsourced
7
  language_creators:
 
2
  pretty_name: NENA Speech Dataset 1.0 (test)
3
  language:
4
  - aii
5
+ - cld
6
  annotations_creators:
7
  - crowdsourced
8
  language_creators:
_common_voice.py CHANGED
@@ -23,6 +23,9 @@ import datasets
23
  from datasets.utils.py_utils import size_str
24
  from tqdm import tqdm
25
 
 
 
 
26
 
27
  _CITATION = """\
28
  @inproceedings{commonvoice:2020,
@@ -41,17 +44,30 @@ _LICENSE = "https://creativecommons.org/publicdomain/zero/1.0/"
41
  # TODO: change "streaming" to "main" after merge!
42
  _BASE_URL = "https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0/resolve/main/"
43
 
44
- _AUDIO_URL = _BASE_URL + "audio/{lang}/{split}.tar"
45
 
46
  _TRANSCRIPT_URL = _BASE_URL + "transcript/{lang}/{split}.tsv"
47
 
 
 
 
48
  class CommonVoiceConfig(datasets.BuilderConfig):
49
  """BuilderConfig for CommonVoice."""
50
 
51
  def __init__(self, name, version, **kwargs):
52
  self.language = kwargs.pop("language", None)
 
 
 
 
 
 
 
53
  description = (
54
- f"This is a test. "
 
 
 
55
  )
56
  super(CommonVoiceConfig, self).__init__(
57
  name=name,
@@ -180,3 +196,4 @@ class CommonVoice(datasets.GeneratorBasedBuilder):
180
  result["audio"] = {"path": path, "bytes": file.read()}
181
  result["path"] = path
182
  yield path, result
 
 
23
  from datasets.utils.py_utils import size_str
24
  from tqdm import tqdm
25
 
26
+ from .languages import LANGUAGES
27
+ from .release_stats import STATS
28
+
29
 
30
  _CITATION = """\
31
  @inproceedings{commonvoice:2020,
 
44
  # TODO: change "streaming" to "main" after merge!
45
  _BASE_URL = "https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0/resolve/main/"
46
 
47
+ _AUDIO_URL = _BASE_URL + "audio/{lang}/{split}/{lang}_{split}_{shard_idx}.tar"
48
 
49
  _TRANSCRIPT_URL = _BASE_URL + "transcript/{lang}/{split}.tsv"
50
 
51
+ _N_SHARDS_URL = _BASE_URL + "n_shards.json"
52
+
53
+
54
  class CommonVoiceConfig(datasets.BuilderConfig):
55
  """BuilderConfig for CommonVoice."""
56
 
57
  def __init__(self, name, version, **kwargs):
58
  self.language = kwargs.pop("language", None)
59
+ self.release_date = kwargs.pop("release_date", None)
60
+ self.num_clips = kwargs.pop("num_clips", None)
61
+ self.num_speakers = kwargs.pop("num_speakers", None)
62
+ self.validated_hr = kwargs.pop("validated_hr", None)
63
+ self.total_hr = kwargs.pop("total_hr", None)
64
+ self.size_bytes = kwargs.pop("size_bytes", None)
65
+ self.size_human = size_str(self.size_bytes)
66
  description = (
67
+ f"Common Voice speech to text dataset in {self.language} released on {self.release_date}. "
68
+ f"The dataset comprises {self.validated_hr} hours of validated transcribed speech data "
69
+ f"out of {self.total_hr} hours in total from {self.num_speakers} speakers. "
70
+ f"The dataset contains {self.num_clips} audio clips and has a size of {self.size_human}."
71
  )
72
  super(CommonVoiceConfig, self).__init__(
73
  name=name,
 
196
  result["audio"] = {"path": path, "bytes": file.read()}
197
  result["path"] = path
198
  yield path, result
199
+
nena_speech_1_0.py CHANGED
@@ -15,7 +15,7 @@ from tqdm import tqdm
15
 
16
  # _HOMEPAGE = "https://commonvoice.mozilla.org/en/datasets"
17
 
18
- # _LICENSE = "https://creativecommons.org/publicdomain/zero/1.0/"
19
 
20
  # TODO: change this
21
  _BASE_URL = "https://huggingface.co/datasets/mnazari/nena_speech_1_0_test/resolve/main/"
@@ -47,12 +47,12 @@ class NENASpeech(datasets.GeneratorBasedBuilder):
47
  NENASpeechConfig(
48
  name='curmi',
49
  version='1.0.5',
50
- language='curmi',
51
  ),
52
  NENASpeechConfig(
53
  name='jurmi',
54
  version='1.0.5',
55
- language='jurmi',
56
  ),
57
  # for lang, lang_stats in STATS["locales"].items()
58
  ]
@@ -92,7 +92,9 @@ class NENASpeech(datasets.GeneratorBasedBuilder):
92
  audio_urls = {}
93
  splits = ("train", "dev", "test")
94
  for split in splits:
95
- audio_urls[split] = _AUDIO_URL.format(dialect=dialect, split=split)
 
 
96
  archive_paths = dl_manager.download(audio_urls)
97
  local_extracted_archive_paths = dl_manager.extract(archive_paths) if not dl_manager.is_streaming else {}
98
 
 
15
 
16
  # _HOMEPAGE = "https://commonvoice.mozilla.org/en/datasets"
17
 
18
+ _LICENSE = "https://creativecommons.org/publicdomain/zero/1.0/"
19
 
20
  # TODO: change this
21
  _BASE_URL = "https://huggingface.co/datasets/mnazari/nena_speech_1_0_test/resolve/main/"
 
47
  NENASpeechConfig(
48
  name='curmi',
49
  version='1.0.5',
50
+ language='aii',
51
  ),
52
  NENASpeechConfig(
53
  name='jurmi',
54
  version='1.0.5',
55
+ language='cld',
56
  ),
57
  # for lang, lang_stats in STATS["locales"].items()
58
  ]
 
92
  audio_urls = {}
93
  splits = ("train", "dev", "test")
94
  for split in splits:
95
+ audio_urls[split] = [
96
+ _AUDIO_URL.format(dialect=dialect, split=split)
97
+ ]
98
  archive_paths = dl_manager.download(audio_urls)
99
  local_extracted_archive_paths = dl_manager.extract(archive_paths) if not dl_manager.is_streaming else {}
100