Convert dataset to Parquet
#1
by
carlosdanielhernandezmena
- opened
- README.md +39 -0
- corpus/files/metadata_dev.tsv +0 -11
- corpus/files/metadata_test.tsv +0 -11
- corpus/files/metadata_train.tsv +0 -21
- corpus/files/tars_dev.paths +0 -1
- corpus/files/tars_test.paths +0 -1
- corpus/files/tars_train.paths +0 -1
- prueba.py +0 -147
- prueba/test-00000-of-00001.parquet +3 -0
- prueba/train-00000-of-00001.parquet +3 -0
- prueba/validation-00000-of-00001.parquet +3 -0
README.md
CHANGED
@@ -1,3 +1,42 @@
|
|
1 |
---
|
2 |
license: cc-by-4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
1 |
---
|
2 |
license: cc-by-4.0
|
3 |
+
dataset_info:
|
4 |
+
config_name: prueba
|
5 |
+
features:
|
6 |
+
- name: audio_id
|
7 |
+
dtype: string
|
8 |
+
- name: audio
|
9 |
+
dtype:
|
10 |
+
audio:
|
11 |
+
sampling_rate: 16000
|
12 |
+
- name: split
|
13 |
+
dtype: string
|
14 |
+
- name: gender
|
15 |
+
dtype: string
|
16 |
+
- name: normalized_text
|
17 |
+
dtype: string
|
18 |
+
- name: relative_path
|
19 |
+
dtype: string
|
20 |
+
splits:
|
21 |
+
- name: train
|
22 |
+
num_bytes: 1557851.0
|
23 |
+
num_examples: 20
|
24 |
+
- name: validation
|
25 |
+
num_bytes: 974796.0
|
26 |
+
num_examples: 10
|
27 |
+
- name: test
|
28 |
+
num_bytes: 809201.0
|
29 |
+
num_examples: 10
|
30 |
+
download_size: 3348995
|
31 |
+
dataset_size: 3341848.0
|
32 |
+
configs:
|
33 |
+
- config_name: prueba
|
34 |
+
data_files:
|
35 |
+
- split: train
|
36 |
+
path: prueba/train-*
|
37 |
+
- split: validation
|
38 |
+
path: prueba/validation-*
|
39 |
+
- split: test
|
40 |
+
path: prueba/test-*
|
41 |
+
default: true
|
42 |
---
|
corpus/files/metadata_dev.tsv
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
audio_id split gender normalized_text relative_path
|
2 |
-
common_voice_es_18328658 dev male ni siquiera pienses en eso vaquero o sí muchacho rudo corpus/speech/dev/male/common_voice_es_18328658.flac
|
3 |
-
common_voice_es_18549611 dev female invitados del cumpleaños a las tres en punto cálmense todos corpus/speech/dev/female/common_voice_es_18549611.flac
|
4 |
-
common_voice_es_19026674 dev male en la supervivencia de la especie corpus/speech/dev/male/common_voice_es_19026674.flac
|
5 |
-
common_voice_es_19159450 dev male antes de la llegada de los europeos era fue una potencia política en halmahera corpus/speech/dev/male/common_voice_es_19159450.flac
|
6 |
-
common_voice_es_19597257 dev male la liga quedó interrumpida en los últimos años de la segunda guerra mundial corpus/speech/dev/male/common_voice_es_19597257.flac
|
7 |
-
common_voice_es_19603417 dev female desde entonces ha participado en numerosas novilladas sin picadores corpus/speech/dev/female/common_voice_es_19603417.flac
|
8 |
-
common_voice_es_19604077 dev male apareció en la película toma estas alas rotas corpus/speech/dev/male/common_voice_es_19604077.flac
|
9 |
-
common_voice_es_19666365 dev female sin embargo a lo largo del capítulo subyace una gran pregunta corpus/speech/dev/female/common_voice_es_19666365.flac
|
10 |
-
common_voice_es_19738526 dev female fue su reino en su tiempo el más poderoso e influyente de europa occidental corpus/speech/dev/female/common_voice_es_19738526.flac
|
11 |
-
common_voice_es_19942148 dev female en las últimas versiones de final cut pro apple inc corpus/speech/dev/female/common_voice_es_19942148.flac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
corpus/files/metadata_test.tsv
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
audio_id split gender normalized_text relative_path
|
2 |
-
common_voice_es_18307761 test male y calló tal vez esperando una disculpa amante pero yo preferí guardar silencio corpus/speech/test/male/common_voice_es_18307761.flac
|
3 |
-
common_voice_es_18569707 test male esos hombres son profesionales son los mejores corpus/speech/test/male/common_voice_es_18569707.flac
|
4 |
-
common_voice_es_18831947 test male uno levanta la caza y otro la mata corpus/speech/test/male/common_voice_es_18831947.flac
|
5 |
-
common_voice_es_19131994 test female ante esta situación el oficial mandó prender fuego a la casa corpus/speech/test/female/common_voice_es_19131994.flac
|
6 |
-
common_voice_es_19523672 test male fue vicario apostólico del uruguay corpus/speech/test/male/common_voice_es_19523672.flac
|
7 |
-
common_voice_es_19610763 test male se desempeñó como mediocampista ofensivo corpus/speech/test/male/common_voice_es_19610763.flac
|
8 |
-
common_voice_es_19629310 test female esta pieza se retira del paciente junto con la aguja corpus/speech/test/female/common_voice_es_19629310.flac
|
9 |
-
common_voice_es_19699841 test female el grupo que acabe antes será el ganador corpus/speech/test/female/common_voice_es_19699841.flac
|
10 |
-
common_voice_es_19960886 test female el gobierno estadounidense no la reconoció como representante del pueblo cubano corpus/speech/test/female/common_voice_es_19960886.flac
|
11 |
-
common_voice_es_20260627 test female fue redactor en jefe de la página deportiva de el diario el país corpus/speech/test/female/common_voice_es_20260627.flac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
corpus/files/metadata_train.tsv
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
audio_id split gender normalized_text relative_path
|
2 |
-
common_voice_es_18306568 train male no me hables acerca de importancia corpus/speech/train/male/common_voice_es_18306568.flac
|
3 |
-
common_voice_es_18320698 train male he restringido el acceso a la cubierta superior corpus/speech/train/male/common_voice_es_18320698.flac
|
4 |
-
common_voice_es_19596707 train male los orígenes precisos de the hood son desconocidos corpus/speech/train/male/common_voice_es_19596707.flac
|
5 |
-
common_voice_es_20501506 train male una vez destruidos se pierden inexorablemente corpus/speech/train/male/common_voice_es_20501506.flac
|
6 |
-
common_voice_es_20507096 train male el resto están todas en inglaterra corpus/speech/train/male/common_voice_es_20507096.flac
|
7 |
-
common_voice_es_20511043 train male las canciones de los comerciales sirvieron como singles para lee entre sus álbumes corpus/speech/train/male/common_voice_es_20511043.flac
|
8 |
-
common_voice_es_20711016 train female los hombres se quedan a jugar a las cartas hasta que amanece sin dormir corpus/speech/train/female/common_voice_es_20711016.flac
|
9 |
-
common_voice_es_20711252 train female con trece años comienza a realizar pequeños papeles para series de televisión y cine corpus/speech/train/female/common_voice_es_20711252.flac
|
10 |
-
common_voice_es_20717545 train female su actividad fuera del campo fue variada corpus/speech/train/female/common_voice_es_20717545.flac
|
11 |
-
common_voice_es_20717953 train female actualmente no está activo corpus/speech/train/female/common_voice_es_20717953.flac
|
12 |
-
common_voice_es_20722210 train female es nativo de farmington hills michigan corpus/speech/train/female/common_voice_es_20722210.flac
|
13 |
-
common_voice_es_20722849 train female incluye el navegador web safari y la aplicación mail de apple corpus/speech/train/female/common_voice_es_20722849.flac
|
14 |
-
common_voice_es_20724424 train female desempeña un papel vital en la promoción del talento nacional e internacional emergente corpus/speech/train/female/common_voice_es_20724424.flac
|
15 |
-
common_voice_es_20725001 train female las grabaciones se extendieron hasta finales del mes de mayo corpus/speech/train/female/common_voice_es_20725001.flac
|
16 |
-
common_voice_es_20931278 train female entre las personas nombradas se encontraba carlos alberto lacoste corpus/speech/train/female/common_voice_es_20931278.flac
|
17 |
-
common_voice_es_20932253 train female hasta el presente ningún vehículo orbital reutilizable real se ha llegado a usar corpus/speech/train/female/common_voice_es_20932253.flac
|
18 |
-
common_voice_es_21469616 train male sus principales producciones fueron escritas para ser representadas ó cantadas corpus/speech/train/male/common_voice_es_21469616.flac
|
19 |
-
common_voice_es_21486095 train male permite eliminar los reflejos luminosos y obtener efectos con las sombras corpus/speech/train/male/common_voice_es_21486095.flac
|
20 |
-
common_voice_es_21543608 train male el número y clase de pájaros varía en cada nivel corpus/speech/train/male/common_voice_es_21543608.flac
|
21 |
-
common_voice_es_21580953 train male la parte norte del brocal es más irregular con una protuberancia hacia el norte noroeste corpus/speech/train/male/common_voice_es_21580953.flac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
corpus/files/tars_dev.paths
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
https://huggingface.co/datasets/carlosdanielhernandezmena/toy_corpus_asr_es/resolve/main/corpus/speech/dev.tar.gz
|
|
|
|
corpus/files/tars_test.paths
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
https://huggingface.co/datasets/carlosdanielhernandezmena/toy_corpus_asr_es/resolve/main/corpus/speech/test.tar.gz
|
|
|
|
corpus/files/tars_train.paths
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
https://huggingface.co/datasets/carlosdanielhernandezmena/toy_corpus_asr_es/resolve/main/corpus/speech/train.tar.gz
|
|
|
|
prueba.py
DELETED
@@ -1,147 +0,0 @@
|
|
1 |
-
from collections import defaultdict
|
2 |
-
import os
|
3 |
-
import json
|
4 |
-
import csv
|
5 |
-
|
6 |
-
import datasets
|
7 |
-
|
8 |
-
_NAME="prueba"
|
9 |
-
_VERSION="1.0.0"
|
10 |
-
|
11 |
-
_DESCRIPTION = """
|
12 |
-
An extremely small corpus of 40 audio files taken from Common Voice (es) with the objective of testing how to share datasets in Hugging Face.
|
13 |
-
"""
|
14 |
-
|
15 |
-
_CITATION = """
|
16 |
-
@misc{toy_corpus_asr_es,
|
17 |
-
title={Toy Corpus for ASR in Spanish.},
|
18 |
-
author={Hernandez Mena, Carlos Daniel},
|
19 |
-
year={2022},
|
20 |
-
url={https://huggingface.co/datasets/carlosdanielhernandezmena/toy_corpus_asr_es},
|
21 |
-
}
|
22 |
-
"""
|
23 |
-
|
24 |
-
_HOMEPAGE = "https://huggingface.co/datasets/carlosdanielhernandezmena/toy_corpus_asr_es"
|
25 |
-
|
26 |
-
_LICENSE = "CC-BY-4.0, See https://creativecommons.org/licenses/by/4.0/"
|
27 |
-
|
28 |
-
_BASE_DATA_DIR = "corpus/"
|
29 |
-
_METADATA_TRAIN = os.path.join(_BASE_DATA_DIR,"files","metadata_train.tsv")
|
30 |
-
_METADATA_TEST = os.path.join(_BASE_DATA_DIR,"files", "metadata_test.tsv")
|
31 |
-
_METADATA_DEV = os.path.join(_BASE_DATA_DIR,"files", "metadata_dev.tsv")
|
32 |
-
|
33 |
-
_TARS_TRAIN = os.path.join(_BASE_DATA_DIR,"files","tars_train.paths")
|
34 |
-
_TARS_TEST = os.path.join(_BASE_DATA_DIR,"files", "tars_test.paths")
|
35 |
-
_TARS_DEV = os.path.join(_BASE_DATA_DIR,"files", "tars_dev.paths")
|
36 |
-
|
37 |
-
class ToyCorpusAsrEsConfig(datasets.BuilderConfig):
|
38 |
-
"""BuilderConfig for Toy Corpus ASR ES."""
|
39 |
-
|
40 |
-
def __init__(self, name, **kwargs):
|
41 |
-
name=_NAME
|
42 |
-
super().__init__(name=name, **kwargs)
|
43 |
-
|
44 |
-
class ToyCorpusAsrEs(datasets.GeneratorBasedBuilder):
|
45 |
-
"""The Toy Corpus ASR ES dataset."""
|
46 |
-
|
47 |
-
VERSION = datasets.Version(_VERSION)
|
48 |
-
BUILDER_CONFIGS = [
|
49 |
-
ToyCorpusAsrEsConfig(
|
50 |
-
name=_NAME,
|
51 |
-
version=datasets.Version(_VERSION),
|
52 |
-
)
|
53 |
-
]
|
54 |
-
|
55 |
-
def _info(self):
|
56 |
-
features = datasets.Features(
|
57 |
-
{
|
58 |
-
"audio_id": datasets.Value("string"),
|
59 |
-
"audio": datasets.Audio(sampling_rate=16000),
|
60 |
-
"split": datasets.Value("string"),
|
61 |
-
"gender": datasets.Value("string"),
|
62 |
-
"normalized_text": datasets.Value("string"),
|
63 |
-
"relative_path": datasets.Value("string"),
|
64 |
-
}
|
65 |
-
)
|
66 |
-
return datasets.DatasetInfo(
|
67 |
-
description=_DESCRIPTION,
|
68 |
-
features=features,
|
69 |
-
homepage=_HOMEPAGE,
|
70 |
-
license=_LICENSE,
|
71 |
-
citation=_CITATION,
|
72 |
-
)
|
73 |
-
|
74 |
-
def _split_generators(self, dl_manager):
|
75 |
-
|
76 |
-
metadata_train=dl_manager.download_and_extract(_METADATA_TRAIN)
|
77 |
-
metadata_test=dl_manager.download_and_extract(_METADATA_TEST)
|
78 |
-
metadata_dev=dl_manager.download_and_extract(_METADATA_DEV)
|
79 |
-
|
80 |
-
tars_train=dl_manager.download_and_extract(_TARS_TRAIN)
|
81 |
-
tars_test=dl_manager.download_and_extract(_TARS_TEST)
|
82 |
-
tars_dev=dl_manager.download_and_extract(_TARS_DEV)
|
83 |
-
|
84 |
-
hash_tar_files=defaultdict(dict)
|
85 |
-
with open(tars_train,'r') as f:
|
86 |
-
hash_tar_files['train']=[path.replace('\n','') for path in f]
|
87 |
-
|
88 |
-
with open(tars_test,'r') as f:
|
89 |
-
hash_tar_files['test']=[path.replace('\n','') for path in f]
|
90 |
-
|
91 |
-
with open(tars_dev,'r') as f:
|
92 |
-
hash_tar_files['dev']=[path.replace('\n','') for path in f]
|
93 |
-
|
94 |
-
hash_meta_paths={"train":metadata_train,"test":metadata_test,"dev":metadata_dev}
|
95 |
-
audio_paths = dl_manager.download(hash_tar_files)
|
96 |
-
|
97 |
-
splits=["train","dev","test"]
|
98 |
-
local_extracted_audio_paths = (
|
99 |
-
dl_manager.extract(audio_paths) if not dl_manager.is_streaming else
|
100 |
-
{
|
101 |
-
split:[None] * len(audio_paths[split]) for split in splits
|
102 |
-
}
|
103 |
-
)
|
104 |
-
|
105 |
-
return [
|
106 |
-
datasets.SplitGenerator(
|
107 |
-
name=datasets.Split.TRAIN,
|
108 |
-
gen_kwargs={
|
109 |
-
"audio_archives":[dl_manager.iter_archive(archive) for archive in audio_paths["train"]],
|
110 |
-
"local_extracted_archives_paths": local_extracted_audio_paths["train"],
|
111 |
-
"metadata_paths": hash_meta_paths["train"],
|
112 |
-
}
|
113 |
-
),
|
114 |
-
datasets.SplitGenerator(
|
115 |
-
name=datasets.Split.VALIDATION,
|
116 |
-
gen_kwargs={
|
117 |
-
"audio_archives": [dl_manager.iter_archive(archive) for archive in audio_paths["dev"]],
|
118 |
-
"local_extracted_archives_paths": local_extracted_audio_paths["dev"],
|
119 |
-
"metadata_paths": hash_meta_paths["dev"],
|
120 |
-
}
|
121 |
-
),
|
122 |
-
datasets.SplitGenerator(
|
123 |
-
name=datasets.Split.TEST,
|
124 |
-
gen_kwargs={
|
125 |
-
"audio_archives": [dl_manager.iter_archive(archive) for archive in audio_paths["test"]],
|
126 |
-
"local_extracted_archives_paths": local_extracted_audio_paths["test"],
|
127 |
-
"metadata_paths": hash_meta_paths["test"],
|
128 |
-
}
|
129 |
-
),
|
130 |
-
]
|
131 |
-
|
132 |
-
def _generate_examples(self, audio_archives, local_extracted_archives_paths, metadata_paths):
|
133 |
-
|
134 |
-
features = ["normalized_text","gender","split","relative_path"]
|
135 |
-
|
136 |
-
with open(metadata_paths) as f:
|
137 |
-
metadata = {x["audio_id"]: x for x in csv.DictReader(f, delimiter="\t")}
|
138 |
-
|
139 |
-
for audio_archive, local_extracted_archive_path in zip(audio_archives, local_extracted_archives_paths):
|
140 |
-
for audio_filename, audio_file in audio_archive:
|
141 |
-
audio_id =os.path.splitext(os.path.basename(audio_filename))[0]
|
142 |
-
path = os.path.join(local_extracted_archive_path, audio_filename) if local_extracted_archive_path else audio_filename
|
143 |
-
yield audio_id, {
|
144 |
-
"audio_id": audio_id,
|
145 |
-
**{feature: metadata[audio_id][feature] for feature in features},
|
146 |
-
"audio": {"path": path, "bytes": audio_file.read()},
|
147 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
prueba/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1a7392478f475db421a8fccea2732485eeee47afd444050f665c4551d1f04005
|
3 |
+
size 810505
|
prueba/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:03030602286e64324044068d87c79a7d88c651a8da3da81c2d71d1cfb174186b
|
3 |
+
size 1560378
|
prueba/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:70bf5ba8051771316a61cb04ca9306cc8b2acb53741d41820eade963aeb5aa86
|
3 |
+
size 978112
|