Datasets:
The viewer is disabled because this dataset repo requires arbitrary Python code execution. Please consider
removing the
loading script
and relying on
automated data support
(you can use
convert_to_parquet
from the datasets
library). If this is not possible, please
open a discussion
for direct help.
Dataset Card for CantoMap
Dataset Summary
The Common Voice dataset consists of a unique MP3 and corresponding text file. Many of the 30328 recorded hours in the dataset also include demographic metadata like age, sex, and accent that can help improve the accuracy of speech recognition engines.
The dataset currently consists of 19673 validated hours in 120 languages, but more voices and languages are always added. Take a look at the Languages page to request a language or start contributing.
Languages
Cantonese
How to use
The datasets
library allows you to load and pre-process your dataset in pure Python, at scale. The dataset can be downloaded and prepared in one call to your local drive by using the load_dataset
function.
For example, to download the Cantonese config, simply specify the corresponding language config name (i.e., "yue" for Cantonese):
from datasets import load_dataset
cv_16 = load_dataset("safecantonese/cantomap", "yue", split="train")
Using the datasets library, you can also stream the dataset on-the-fly by adding a streaming=True
argument to the load_dataset
function call. Loading a dataset in streaming mode loads individual samples of the dataset at a time, rather than downloading the entire dataset to disk.
from datasets import load_dataset
cv_16 = load_dataset("safecantonese/cantomap", "yue", split="train", streaming=True)
print(next(iter(cv_16)))
Bonus: create a PyTorch dataloader directly with your own datasets (local/streamed).
Local
from datasets import load_dataset
from torch.utils.data.sampler import BatchSampler, RandomSampler
cv_16 = load_dataset("safecantonese/cantomap", "yue", split="train")
batch_sampler = BatchSampler(RandomSampler(cv_16), batch_size=32, drop_last=False)
dataloader = DataLoader(cv_16, batch_sampler=batch_sampler)
Streaming
from datasets import load_dataset
from torch.utils.data import DataLoader
cv_16 = load_dataset("safecantonese/cantomap", "yue", split="train")
dataloader = DataLoader(cv_16, batch_size=32)
To find out more about loading and preparing audio datasets, head over to hf.co/blog/audio-datasets.
Example scripts
Train your own CTC or Seq2Seq Automatic Speech Recognition models on CantoMap with transformers
- here.
Dataset Structure
Data Instances
A typical data point comprises the path
to the audio file and its sentence
.
{
'path': 'et/clips/common_voice_et_18318995.mp3',
'audio': {
'path': 'et/clips/common_voice_et_18318995.mp3',
'array': array([-0.00048828, -0.00018311, -0.00137329, ..., 0.00079346, 0.00091553, 0.00085449], dtype=float32),
'sampling_rate': 48000
},
'sentence': 'Tasub kokku saada inimestega, keda tunned juba ammust ajast saati.',
}
Data Fields
path
(string
): The path to the audio file
audio
(dict
): A dictionary containing the path to the downloaded audio file, the decoded audio array, and the sampling rate. Note that when accessing the audio column: dataset[0]["audio"]
the audio file is automatically decoded and resampled to dataset.features["audio"].sampling_rate
. Decoding and resampling of a large number of audio files might take a significant amount of time. Thus it is important to first query the sample index before the "audio"
column, i.e. dataset[0]["audio"]
should always be preferred over dataset["audio"][0]
.
sentence
(string
): The sentence the user was prompted to speak
Data Splits
The speech material has been subdivided into portions for train and test.
Additional Information
Licensing Information
gpl-3.0
Citation Information
@inproceedings{lrec:2020,
author = {Winterstein, Grégoire, Tang, Carmen and Lai, Regine},
title = {CantoMap: a Hong Kong Cantonese MapTask Corpus}
}
- Downloads last month
- 87