|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"""TODO: Add a description here.""" |
|
|
|
from __future__ import absolute_import, division, print_function |
|
|
|
import os |
|
|
|
import datasets |
|
|
|
|
|
|
|
|
|
_CITATION = """\ |
|
@inproceedings{commonvoice:2020, |
|
author = {Ardila, R. and Branson, M. and Davis, K. and Henretty, M. and Kohler, M. and Meyer, J. and Morais, R. and Saunders, L. and Tyers, F. M. and Weber, G.}, |
|
title = {Common Voice: A Massively-Multilingual Speech Corpus}, |
|
booktitle = {Proceedings of the 12th Conference on Language Resources and Evaluation (LREC 2020)}, |
|
pages = {4211--4215}, |
|
year = 2020 |
|
} |
|
""" |
|
|
|
|
|
|
|
_DESCRIPTION = """\ |
|
Common Voice is Mozilla's initiative to help teach machines how real people speak. |
|
The dataset currently consists of 7,335 validated hours of speech in 60 languages, but we’re always adding more voices and languages. |
|
""" |
|
|
|
|
|
_HOMEPAGE = "https://commonvoice.mozilla.org/en/datasets" |
|
|
|
|
|
_LICENSE = "https://github.com/common-voice/common-voice/blob/main/LICENSE" |
|
|
|
|
|
|
|
|
|
_URLs = { |
|
'first_domain': "https://mozilla-common-voice-datasets.s3.dualstack.us-west-2.amazonaws.com/cv-corpus-6.1-2020-12-11/en.tar.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAQ3GQRTO3CAFSOHXG%2F20210212%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210212T082132Z&X-Amz-Expires=43200&X-Amz-Security-Token=FwoGZXIvYXdzEOr%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDDBRxPQbFwld%2BrOewCKSBOR7k7VaqtnM0zucItVC0gdXyV4Uh5qtOx0vhTzhGRJ2r0mKkJ5FNL8bMe5TWtcX0IEH8HHTs28S%2BDerVhBD%2FGKfxy6J4BQCjhR0J8AoqwEYm0qRVm5b7tbWBNYetD5c8HxYGWWRppvaYxRxdnRbupfKuGpMEf3eYskfH8tAA739HbcKj44LGe4lkKsGvI1avxrxrNugcrNF%2BOccEdNInU%2F%2BVQvoFUu93oAEhJWl8dWXswDtZSCmuvfTjCbsZjphoSfTz5t0T25qXwP3PpcZTRVrYm9rQ4GGwaiva9qs0Q0nA0mC0skcMLF%2BZMxfo4wtaDfneDoPgNITqHtLyXLKeXRwIhHUzjNriniNNTp3XJyivc6qr6uNJ23IysUKfqNfQ2EiZC07VEQlVcYoSBKNHvGEIHsXfICaQ4MyHSl7dJa0CaSOAjBytNMxxhqCCLylJ%2BEgnO45VS5X12z8D3vTyyjR67hqXKDHwdTioVTlK3j%2FTXWRHDw31EbikSkhDKubD%2F2VDJLMul7cXjpCWygmJXHKG%2BNQKM09vP3pdmuVuQ1Z8an8OPMTnGKJEOsKXkrCJTOjvQVAl7z4KKlA9UW0Hp0u%2FoZnT%2Fxgi7dvqwu1Fq7%2BRQ%2BkXi3LT6lA%2B%2BJfO2HEOnlcsg1TFompSGp0dD12F3iTQNmKAuakCdunLyQRd%2Bgi2vRmwfsPyHOnRiJVbyghoEWyKLHtmIEGMir%2B01wURSgc46vtaXqBOz5Gtj4bF5wkpw6TCh%2FiHFn7Fx6igw69uJmKtpI%3D&X-Amz-Signature=573df56b8f6aa8e13b2fa26fa0763718e25f2d7a33e0be97ea5ff82680d82474&X-Amz-SignedHeaders=host" |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_LANGUAGES = { |
|
"Abkhaz": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Arabic": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Assamese": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Breton": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Catalan": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Hakha Chin": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Czech": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Chuvash": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Welsh": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Abkhaz": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"German": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Dhivehi": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Greek": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"English": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Esperanto": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Spanish": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Estonian": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Basque": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Persian": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Finnish": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"French": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Frisian": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Irish": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Hindi": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Sorbian, Upper": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Hungarian": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"InterLinguia": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Indonesian": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Italian": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Japanese": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14, |
|
"Download_Link": "https://asr-dataset-ja.s3-ap-northeast-1.amazonaws.com/common-voice/original/1.0.0/ja.tar" |
|
},"Georgian": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Kabyle": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Kyrgyz": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Luganda": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"German": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Lithuanian": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Latvian": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Mongolian": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Maltese": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Dutch": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14, |
|
"Download_Link": "https://mozilla-common-voice-datasets.s3.dualstack.us-west-2.amazonaws.com/cv-corpus-6.1-2020-12-11/nl.tar.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAQ3GQRTO3ND4UAQXB%2F20210217%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210217T080740Z&X-Amz-Expires=43200&X-Amz-Security-Token=FwoGZXIvYXdzEGIaDCC6ALh%2FwIK9ovvRdCKSBCs5WaSJNsZ2h0SnhpnWFv4yiAJHJTe%2BY6pBcCqadRMs0RABHeQ2n1QDACJ5V9WOqIHfMfT0AI%2Bfe6iFkTGLgRrJOMYpgV%2FmIBcXCjeb72r4ZvudMA8tprkSxZsEh53bJkIDQx1tXqfpz0yoefM0geD3461suEGhHnLIyiwffrUpRg%2BkNZN9%2FLZZXpF5F2pogieKKV533Jetkd1xlWOR%2Bem9R2bENu2RV563XX3JvbWxSYN9IHkVT1xwd4ZiOpUtX7%2F2RoluJUKw%2BUPpyml3J%2FOPPGdr7CyPLjqNxdq9ceRi8lRybty64XvNYZGt45VNTQ3pkTTz4VpUCJAGkgxq95Ve%2BOwW%2Fsc8JtblTFKrH11vej62NB7C0n7JPPS4SLKXHKW%2B7ZbybcNf3BnsAVouPdsGTMslcgkD81b9trnjyXJdOZkzdHUf2KcWVXVceEsZnMhcCZQ1cJpI7qXPEk8QrKCQcNByPLHmPIEdHpj9IrIBKDkl2qO7VX7CCB65WDt2eZRltOcNHXWVFXFktMdQOQztI1j0XSZz2iOX4jPKKaqz193VEytlAqmehNi8pePOnxkP9Z1SP7d3I6rayuBF3phmpHxw499tY3ECYYgoCnJ6QSFa3KxMjFmEpQlmjxuwEMHd4CDL2FJYGcCiIxbCcL1r8ZE3%2BbGdcu7PRsVCHX3Huh%2FqGIaF4h40FgteN6teyKCHKOebs4EGMipb9xmEMZ9ZbVopz4bkhLdMTrjKon9w624Xem0MTPqN7XY%2BB6lRgrW8rd4%3D&X-Amz-Signature=28eabdfce72a472a70b0f9e1e2c37fe1471b5ec8ed60614fbe900bfa97ae1ac8&X-Amz-SignedHeaders=host" |
|
},"Odia": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Punjabi": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
}, |
|
"Polish": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Portuguese": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Romansh Sursilvan": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Romansh Vallader": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Romanian": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Russian": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Kinyarwanda": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Sakha": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Slovenian": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Swedish": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Tamil": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Thai": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Turkish": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Tatar": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Ukrainian": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Vietnamese": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Votic": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Chinese (China)": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Chinese (Hong Kong)": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
},"Chinese (Taiwan": { |
|
"Date": "2020-12-11", |
|
"Size": "39 MB", |
|
"Version": "ab_1h_2020-12-11", |
|
"Validated_Hr_Total": 0.05, |
|
"Overall_Hr_Total": 1, |
|
"Number_Of_Voice": 14 |
|
} |
|
} |
|
|
|
|
|
class CommonVoiceConfig(datasets.BuilderConfig): |
|
"""BuilderConfig for CommonVoice.""" |
|
|
|
def __init__(self, name, sub_version, **kwargs): |
|
""" |
|
Args: |
|
data_dir: `string`, the path to the folder containing the files in the |
|
downloaded .tar |
|
citation: `string`, citation for the data set |
|
url: `string`, url for information about the data set |
|
**kwargs: keyword arguments forwarded to super. |
|
""" |
|
self.language = name |
|
self.sub_version = sub_version |
|
self.date_of_snapshot = kwargs.pop("date", None) |
|
self.size = kwargs.pop("size", None) |
|
self.validated_hr_total = kwargs.pop("val_hrs", None) |
|
self.total_hr_total = kwargs.pop("total_hrs", None) |
|
self.num_of_voice = kwargs.pop("num_of_voice", None) |
|
description = f"Common Voice speech to text dataset in {self.language} version {self.sub_version} of {self.date_of_snapshot}. The dataset comprises {self.validated_hr_total} of validated transcribed speech data from {self.num_of_voice} speakers. The dataset has a size of {self.size}" |
|
super(CommonVoiceConfig, self).__init__(name=name, version=datasets.Version("6.1.0", ""), description=description, **kwargs) |
|
|
|
|
|
|
|
class CommonVoice(datasets.GeneratorBasedBuilder): |
|
"""TODO: Short description of my dataset.""" |
|
|
|
@property |
|
def manual_download_instructions(self): |
|
return """\ |
|
You need to go to https://commonvoice.mozilla.org/en/datasets, |
|
and manually download the dataset as a .tar file. Once it is completed, |
|
a folder will be made containing the files, validated.tsv, train.tsv, test.tsv, reported.tsv, other.tsv, invalidated.tsv, dev.tsv |
|
and the folder clips containing audiofiles sampled at 48khz. Each clip is around 3-4 seconds in duration with a size of around 20-50 khz""" |
|
|
|
BUILDER_CONFIGS = [ |
|
CommonVoiceConfig( |
|
name=lang, |
|
sub_version=_LANGUAGES[lang]["Version"], |
|
date=_LANGUAGES[lang]["Date"], |
|
size=_LANGUAGES[lang]["Size"], |
|
val_hrs=_LANGUAGES[lang]["Validated_Hr_Total"], |
|
total_hrs=_LANGUAGES[lang]["Overall_Hr_Total"], |
|
num_of_voice=_LANGUAGES[lang]["Number_Of_Voice"], |
|
) |
|
for lang in _LANGUAGES.keys() |
|
] |
|
|
|
|
|
|
|
def _info(self): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
features = datasets.Features( |
|
{ |
|
"client_id": datasets.Value("string"), |
|
"path": datasets.Value("string"), |
|
"sentence": datasets.Value("string"), |
|
"up_votes": datasets.Value("int64"), |
|
"down_votes": datasets.Value("int64"), |
|
"age": datasets.Value("string"), |
|
"gender": datasets.Value("string"), |
|
"accent": datasets.Value("string"), |
|
"locale": datasets.Value("string"), |
|
"segment": datasets.Value("string"), |
|
} |
|
) |
|
|
|
return datasets.DatasetInfo( |
|
|
|
description=_DESCRIPTION, |
|
|
|
features=features, |
|
|
|
|
|
|
|
supervised_keys=None, |
|
|
|
homepage=_HOMEPAGE, |
|
|
|
license=_LICENSE, |
|
|
|
citation=_CITATION, |
|
) |
|
|
|
def _split_generators(self, dl_manager): |
|
"""Returns SplitGenerators.""" |
|
|
|
|
|
|
|
|
|
|
|
|
|
abs_path_to_data = os.path.abspath(dl_manager.manual_dir) |
|
abs_path_to_clips = os.path.join(abs_path_to_data, "clips") |
|
|
|
return [ |
|
datasets.SplitGenerator( |
|
name=datasets.Split.TRAIN, |
|
gen_kwargs={ |
|
"filepath": os.path.join(abs_path_to_data, "train.tsv"), |
|
"path_to_clips": abs_path_to_clips, |
|
}, |
|
), |
|
datasets.SplitGenerator( |
|
name=datasets.Split.TEST, |
|
gen_kwargs={ |
|
"filepath": os.path.join(abs_path_to_data, "test.tsv"), |
|
"path_to_clips": abs_path_to_clips, |
|
}, |
|
), |
|
datasets.SplitGenerator( |
|
name=datasets.Split.VALIDATION, |
|
gen_kwargs={ |
|
"filepath": os.path.join(abs_path_to_data, "dev.tsv"), |
|
"path_to_clips": abs_path_to_clips, |
|
}, |
|
), |
|
datasets.SplitGenerator( |
|
name="other", |
|
gen_kwargs={ |
|
"filepath": os.path.join(abs_path_to_data, "other.tsv"), |
|
"path_to_clips": abs_path_to_clips, |
|
}, |
|
), |
|
datasets.SplitGenerator( |
|
name="invalidated", |
|
gen_kwargs={ |
|
"filepath": os.path.join(abs_path_to_data, "invalidated.tsv"), |
|
"path_to_clips": abs_path_to_clips, |
|
}, |
|
), |
|
] |
|
|
|
def _generate_examples(self, filepath, path_to_clips): |
|
""" Yields examples. """ |
|
|
|
|
|
|
|
data_fields = list(self._info().features.keys()) |
|
path_idx = data_fields.index("path") |
|
|
|
with open(filepath, encoding="utf-8") as f: |
|
lines = f.readlines() |
|
headline = lines[0] |
|
|
|
column_names = headline.strip().split("\t") |
|
assert column_names == data_fields, f"The file should have {data_fields} as column names, but has {column_names}" |
|
|
|
for id_, line in enumerate(lines[1:]): |
|
field_values = line.strip().split("\t") |
|
|
|
|
|
field_values[path_idx] = os.path.join(path_to_clips, field_values[path_idx]) |
|
|
|
|
|
if len(field_values) < len(data_fields): |
|
field_values += (len(data_fields) - len(field_values)) * ["''"] |
|
|
|
yield id_, { |
|
key: value for key, value in zip(data_fields, field_values) |
|
} |
|
|