Datasets:
Languages:
Sundanese
Tags:
speech-recognition
alvinxrwui
commited on
Commit
•
d2f6576
1
Parent(s):
d12a545
init
Browse files- README.md +79 -0
- __init__.py +0 -0
- requirements.txt +1 -0
- su_id_asr.py +147 -0
README.md
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
language:
|
4 |
+
- sun
|
5 |
+
pretty_name: Su Id Asr
|
6 |
+
task_categories:
|
7 |
+
- speech-recognition
|
8 |
+
tags:
|
9 |
+
- speech-recognition
|
10 |
+
---
|
11 |
+
|
12 |
+
Sundanese ASR training data set containing ~220K utterances.
|
13 |
+
This dataset was collected by Google in Indonesia.
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
## Languages
|
19 |
+
|
20 |
+
sun
|
21 |
+
|
22 |
+
## Supported Tasks
|
23 |
+
|
24 |
+
Speech Recognition
|
25 |
+
|
26 |
+
## Dataset Usage
|
27 |
+
### Using `datasets` library
|
28 |
+
```
|
29 |
+
from datasets import load_dataset
|
30 |
+
dset = datasets.load_dataset("SEACrowd/su_id_asr", trust_remote_code=True)
|
31 |
+
```
|
32 |
+
### Using `seacrowd` library
|
33 |
+
```import seacrowd as sc
|
34 |
+
# Load the dataset using the default config
|
35 |
+
dset = sc.load_dataset("su_id_asr", schema="seacrowd")
|
36 |
+
# Check all available subsets (config names) of the dataset
|
37 |
+
print(sc.available_config_names("su_id_asr"))
|
38 |
+
# Load the dataset using a specific config
|
39 |
+
dset = sc.load_dataset_by_config_name(config_name="<config_name>")
|
40 |
+
```
|
41 |
+
|
42 |
+
More details on how to load the `seacrowd` library can be found [here](https://github.com/SEACrowd/seacrowd-datahub?tab=readme-ov-file#how-to-use).
|
43 |
+
|
44 |
+
|
45 |
+
## Dataset Homepage
|
46 |
+
|
47 |
+
[https://indonlp.github.io/nusa-catalogue/card.html?su_id_asr](https://indonlp.github.io/nusa-catalogue/card.html?su_id_asr)
|
48 |
+
|
49 |
+
## Dataset Version
|
50 |
+
|
51 |
+
Source: 1.0.0. SEACrowd: 2024.06.20.
|
52 |
+
|
53 |
+
## Dataset License
|
54 |
+
|
55 |
+
Attribution-ShareAlike 4.0 International.
|
56 |
+
|
57 |
+
## Citation
|
58 |
+
|
59 |
+
If you are using the **Su Id Asr** dataloader in your work, please cite the following:
|
60 |
+
```
|
61 |
+
@inproceedings{sodimana18_sltu,
|
62 |
+
author={Keshan Sodimana and Pasindu {De Silva} and Supheakmungkol Sarin and Oddur Kjartansson and Martin Jansche and Knot Pipatsrisawat and Linne Ha},
|
63 |
+
title={{A Step-by-Step Process for Building TTS Voices Using Open Source Data and Frameworks for Bangla, Javanese, Khmer, Nepali, Sinhala, and Sundanese}},
|
64 |
+
year=2018,
|
65 |
+
booktitle={Proc. 6th Workshop on Spoken Language Technologies for Under-Resourced Languages (SLTU 2018)},
|
66 |
+
pages={66--70},
|
67 |
+
doi={10.21437/SLTU.2018-14}
|
68 |
+
}
|
69 |
+
|
70 |
+
|
71 |
+
@article{lovenia2024seacrowd,
|
72 |
+
title={SEACrowd: A Multilingual Multimodal Data Hub and Benchmark Suite for Southeast Asian Languages},
|
73 |
+
author={Holy Lovenia and Rahmad Mahendra and Salsabil Maulana Akbar and Lester James V. Miranda and Jennifer Santoso and Elyanah Aco and Akhdan Fadhilah and Jonibek Mansurov and Joseph Marvin Imperial and Onno P. Kampman and Joel Ruben Antony Moniz and Muhammad Ravi Shulthan Habibi and Frederikus Hudi and Railey Montalan and Ryan Ignatius and Joanito Agili Lopo and William Nixon and Börje F. Karlsson and James Jaya and Ryandito Diandaru and Yuze Gao and Patrick Amadeus and Bin Wang and Jan Christian Blaise Cruz and Chenxi Whitehouse and Ivan Halim Parmonangan and Maria Khelli and Wenyu Zhang and Lucky Susanto and Reynard Adha Ryanda and Sonny Lazuardi Hermawan and Dan John Velasco and Muhammad Dehan Al Kautsar and Willy Fitra Hendria and Yasmin Moslem and Noah Flynn and Muhammad Farid Adilazuarda and Haochen Li and Johanes Lee and R. Damanhuri and Shuo Sun and Muhammad Reza Qorib and Amirbek Djanibekov and Wei Qi Leong and Quyet V. Do and Niklas Muennighoff and Tanrada Pansuwan and Ilham Firdausi Putra and Yan Xu and Ngee Chia Tai and Ayu Purwarianti and Sebastian Ruder and William Tjhi and Peerat Limkonchotiwat and Alham Fikri Aji and Sedrick Keh and Genta Indra Winata and Ruochen Zhang and Fajri Koto and Zheng-Xin Yong and Samuel Cahyawijaya},
|
74 |
+
year={2024},
|
75 |
+
eprint={2406.10118},
|
76 |
+
journal={arXiv preprint arXiv: 2406.10118}
|
77 |
+
}
|
78 |
+
|
79 |
+
```
|
__init__.py
ADDED
File without changes
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
seacrowd>=0.2.0
|
su_id_asr.py
ADDED
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import csv
|
2 |
+
import os
|
3 |
+
from typing import Dict, List
|
4 |
+
|
5 |
+
import datasets
|
6 |
+
|
7 |
+
from seacrowd.utils import schemas
|
8 |
+
from seacrowd.utils.configs import SEACrowdConfig
|
9 |
+
from seacrowd.utils.constants import (DEFAULT_SEACROWD_VIEW_NAME,
|
10 |
+
DEFAULT_SOURCE_VIEW_NAME, Tasks)
|
11 |
+
|
12 |
+
_DATASETNAME = "su_id_asr"
|
13 |
+
_SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
|
14 |
+
_UNIFIED_VIEW_NAME = DEFAULT_SEACROWD_VIEW_NAME
|
15 |
+
|
16 |
+
_LANGUAGES = ["sun"]
|
17 |
+
_LOCAL = False
|
18 |
+
_CITATION = """\
|
19 |
+
@inproceedings{sodimana18_sltu,
|
20 |
+
author={Keshan Sodimana and Pasindu {De Silva} and Supheakmungkol Sarin and Oddur Kjartansson and Martin Jansche and Knot Pipatsrisawat and Linne Ha},
|
21 |
+
title={{A Step-by-Step Process for Building TTS Voices Using Open Source Data and Frameworks for Bangla, Javanese, Khmer, Nepali, Sinhala, and Sundanese}},
|
22 |
+
year=2018,
|
23 |
+
booktitle={Proc. 6th Workshop on Spoken Language Technologies for Under-Resourced Languages (SLTU 2018)},
|
24 |
+
pages={66--70},
|
25 |
+
doi={10.21437/SLTU.2018-14}
|
26 |
+
}
|
27 |
+
"""
|
28 |
+
|
29 |
+
_DESCRIPTION = """\
|
30 |
+
Sundanese ASR training data set containing ~220K utterances.
|
31 |
+
This dataset was collected by Google in Indonesia.
|
32 |
+
"""
|
33 |
+
|
34 |
+
_HOMEPAGE = "https://indonlp.github.io/nusa-catalogue/card.html?su_id_asr"
|
35 |
+
|
36 |
+
_LICENSE = "Attribution-ShareAlike 4.0 International."
|
37 |
+
|
38 |
+
_URLs = {
|
39 |
+
"su_id_asr": "https://www.openslr.org/resources/36/asr_sundanese_{}.zip",
|
40 |
+
}
|
41 |
+
|
42 |
+
_SUPPORTED_TASKS = [Tasks.SPEECH_RECOGNITION]
|
43 |
+
|
44 |
+
_SOURCE_VERSION = "1.0.0"
|
45 |
+
_SEACROWD_VERSION = "2024.06.20"
|
46 |
+
|
47 |
+
|
48 |
+
class SuIdASR(datasets.GeneratorBasedBuilder):
|
49 |
+
"""su_id contains ~220K utterances for Sundanese ASR training data."""
|
50 |
+
|
51 |
+
BUILDER_CONFIGS = [
|
52 |
+
SEACrowdConfig(
|
53 |
+
name="su_id_asr_source",
|
54 |
+
version=datasets.Version(_SOURCE_VERSION),
|
55 |
+
description="SU_ID_ASR source schema",
|
56 |
+
schema="source",
|
57 |
+
subset_id="su_id_asr",
|
58 |
+
),
|
59 |
+
SEACrowdConfig(
|
60 |
+
name="su_id_asr_seacrowd_sptext",
|
61 |
+
version=datasets.Version(_SEACROWD_VERSION),
|
62 |
+
description="SU_ID_ASR Nusantara schema",
|
63 |
+
schema="seacrowd_sptext",
|
64 |
+
subset_id="su_id_asr",
|
65 |
+
),
|
66 |
+
]
|
67 |
+
|
68 |
+
DEFAULT_CONFIG_NAME = "su_id_asr_source"
|
69 |
+
|
70 |
+
def _info(self):
|
71 |
+
if self.config.schema == "source":
|
72 |
+
features = datasets.Features(
|
73 |
+
{
|
74 |
+
"id": datasets.Value("string"),
|
75 |
+
"speaker_id": datasets.Value("string"),
|
76 |
+
"path": datasets.Value("string"),
|
77 |
+
"audio": datasets.Audio(sampling_rate=16_000),
|
78 |
+
"text": datasets.Value("string"),
|
79 |
+
}
|
80 |
+
)
|
81 |
+
elif self.config.schema == "seacrowd_sptext":
|
82 |
+
features = schemas.speech_text_features
|
83 |
+
|
84 |
+
return datasets.DatasetInfo(
|
85 |
+
description=_DESCRIPTION,
|
86 |
+
features=features,
|
87 |
+
homepage=_HOMEPAGE,
|
88 |
+
license=_LICENSE,
|
89 |
+
citation=_CITATION,
|
90 |
+
task_templates=[datasets.AutomaticSpeechRecognition(audio_column="audio", transcription_column="text")],
|
91 |
+
)
|
92 |
+
|
93 |
+
def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
|
94 |
+
base_path = {}
|
95 |
+
for id in range(10):
|
96 |
+
base_path[id] = dl_manager.download_and_extract(_URLs["su_id_asr"].format(str(id)))
|
97 |
+
for id in ["a", "b", "c", "d", "e", "f"]:
|
98 |
+
base_path[id] = dl_manager.download_and_extract(_URLs["su_id_asr"].format(str(id)))
|
99 |
+
return [
|
100 |
+
datasets.SplitGenerator(
|
101 |
+
name=datasets.Split.TRAIN,
|
102 |
+
gen_kwargs={"filepath": base_path},
|
103 |
+
),
|
104 |
+
]
|
105 |
+
|
106 |
+
def _generate_examples(self, filepath: Dict):
|
107 |
+
|
108 |
+
if self.config.schema == "source" or self.config.schema == "seacrowd_sptext":
|
109 |
+
|
110 |
+
for key, each_filepath in filepath.items():
|
111 |
+
|
112 |
+
tsv_file = os.path.join(each_filepath, "asr_sundanese", "utt_spk_text.tsv")
|
113 |
+
|
114 |
+
with open(tsv_file, "r") as file:
|
115 |
+
tsv_file = csv.reader(file, delimiter="\t")
|
116 |
+
|
117 |
+
for line in tsv_file:
|
118 |
+
audio_id, speaker_id, transcription_text = line[0], line[1], line[2]
|
119 |
+
|
120 |
+
wav_path = os.path.join(each_filepath, "asr_sundanese", "data", "{}".format(audio_id[:2]), "{}.flac".format(audio_id))
|
121 |
+
|
122 |
+
if os.path.exists(wav_path):
|
123 |
+
if self.config.schema == "source":
|
124 |
+
ex = {
|
125 |
+
"id": audio_id,
|
126 |
+
"speaker_id": speaker_id,
|
127 |
+
"path": wav_path,
|
128 |
+
"audio": wav_path,
|
129 |
+
"text": transcription_text,
|
130 |
+
}
|
131 |
+
yield audio_id, ex
|
132 |
+
elif self.config.schema == "seacrowd_sptext":
|
133 |
+
ex = {
|
134 |
+
"id": audio_id,
|
135 |
+
"speaker_id": speaker_id,
|
136 |
+
"path": wav_path,
|
137 |
+
"audio": wav_path,
|
138 |
+
"text": transcription_text,
|
139 |
+
"metadata": {
|
140 |
+
"speaker_age": None,
|
141 |
+
"speaker_gender": None,
|
142 |
+
},
|
143 |
+
}
|
144 |
+
yield audio_id, ex
|
145 |
+
|
146 |
+
else:
|
147 |
+
raise ValueError(f"Invalid config: {self.config.name}")
|