Datasets:
Convert dataset to Parquet
#1
by
carlosdanielhernandezmena
- opened
- README.md +29 -0
- corpus/files/metadata_train.tsv +0 -0
- corpus/files/tars_train.paths +0 -1
- tele_con_ciencia.py +0 -123
- corpus/speech/train.tar.gz → tele_con_ciencia/train-00000-of-00005.parquet +2 -2
- tele_con_ciencia/train-00001-of-00005.parquet +3 -0
- tele_con_ciencia/train-00002-of-00005.parquet +3 -0
- tele_con_ciencia/train-00003-of-00005.parquet +3 -0
- tele_con_ciencia/train-00004-of-00005.parquet +3 -0
README.md
CHANGED
@@ -1,3 +1,32 @@
|
|
1 |
---
|
2 |
license: cc-by-4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
1 |
---
|
2 |
license: cc-by-4.0
|
3 |
+
dataset_info:
|
4 |
+
config_name: tele_con_ciencia
|
5 |
+
features:
|
6 |
+
- name: audio_id
|
7 |
+
dtype: string
|
8 |
+
- name: audio
|
9 |
+
dtype:
|
10 |
+
audio:
|
11 |
+
sampling_rate: 16000
|
12 |
+
- name: speaker_id
|
13 |
+
dtype: string
|
14 |
+
- name: gender
|
15 |
+
dtype: string
|
16 |
+
- name: duration
|
17 |
+
dtype: float32
|
18 |
+
- name: normalized_text
|
19 |
+
dtype: string
|
20 |
+
splits:
|
21 |
+
- name: train
|
22 |
+
num_bytes: 2048626261.057
|
23 |
+
num_examples: 12073
|
24 |
+
download_size: 2041645393
|
25 |
+
dataset_size: 2048626261.057
|
26 |
+
configs:
|
27 |
+
- config_name: tele_con_ciencia
|
28 |
+
data_files:
|
29 |
+
- split: train
|
30 |
+
path: tele_con_ciencia/train-*
|
31 |
+
default: true
|
32 |
---
|
corpus/files/metadata_train.tsv
DELETED
The diff for this file is too large to render.
See raw diff
|
|
corpus/files/tars_train.paths
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
corpus/speech/train.tar.gz
|
|
|
|
tele_con_ciencia.py
DELETED
@@ -1,123 +0,0 @@
|
|
1 |
-
from collections import defaultdict
|
2 |
-
import os
|
3 |
-
import json
|
4 |
-
import csv
|
5 |
-
|
6 |
-
import datasets
|
7 |
-
|
8 |
-
_NAME="tele_con_ciencia"
|
9 |
-
_VERSION="1.0.0"
|
10 |
-
|
11 |
-
_DESCRIPTION = """
|
12 |
-
TELEconCIENCIA SPANISH CORPUS. Audio and Transcripts in Spanish in a
|
13 |
-
CIEMPIESS Corpus style, taken from the radio program Tele con Ciencia
|
14 |
-
by CONACYT.
|
15 |
-
"""
|
16 |
-
|
17 |
-
_CITATION = """
|
18 |
-
@misc{menateleconciencia2019,
|
19 |
-
title={TELEconCIENCIA SPANISH CORPUS: Audio and Transcripts in Spanish taken from broadcast radio programs.},
|
20 |
-
author={Hernandez Mena, Carlos Daniel},
|
21 |
-
year={2019},
|
22 |
-
url={https://huggingface.co/ciempiess/tele_con_ciencia},
|
23 |
-
}
|
24 |
-
"""
|
25 |
-
|
26 |
-
_HOMEPAGE = "https://huggingface.co/ciempiess/tele_con_ciencia"
|
27 |
-
|
28 |
-
_LICENSE = "CC-BY-SA-4.0, See https://creativecommons.org/licenses/by-sa/4.0/"
|
29 |
-
|
30 |
-
_BASE_DATA_DIR = "corpus/"
|
31 |
-
_METADATA_TRAIN = os.path.join(_BASE_DATA_DIR,"files", "metadata_train.tsv")
|
32 |
-
|
33 |
-
_TARS_TRAIN = os.path.join(_BASE_DATA_DIR,"files", "tars_train.paths")
|
34 |
-
|
35 |
-
class TeleconCienciaConfig(datasets.BuilderConfig):
|
36 |
-
"""BuilderConfig for TELEconCIENCIA SPANISH CORPUS"""
|
37 |
-
|
38 |
-
def __init__(self, name, **kwargs):
|
39 |
-
name=_NAME
|
40 |
-
super().__init__(name=name, **kwargs)
|
41 |
-
|
42 |
-
class TeleconCiencia(datasets.GeneratorBasedBuilder):
|
43 |
-
"""TELEconCIENCIA SPANISH CORPUS"""
|
44 |
-
|
45 |
-
VERSION = datasets.Version(_VERSION)
|
46 |
-
BUILDER_CONFIGS = [
|
47 |
-
TeleconCienciaConfig(
|
48 |
-
name=_NAME,
|
49 |
-
version=datasets.Version(_VERSION),
|
50 |
-
)
|
51 |
-
]
|
52 |
-
|
53 |
-
def _info(self):
|
54 |
-
features = datasets.Features(
|
55 |
-
{
|
56 |
-
"audio_id": datasets.Value("string"),
|
57 |
-
"audio": datasets.Audio(sampling_rate=16000),
|
58 |
-
"speaker_id": datasets.Value("string"),
|
59 |
-
"gender": datasets.Value("string"),
|
60 |
-
"duration": datasets.Value("float32"),
|
61 |
-
"normalized_text": datasets.Value("string"),
|
62 |
-
}
|
63 |
-
)
|
64 |
-
return datasets.DatasetInfo(
|
65 |
-
description=_DESCRIPTION,
|
66 |
-
features=features,
|
67 |
-
homepage=_HOMEPAGE,
|
68 |
-
license=_LICENSE,
|
69 |
-
citation=_CITATION,
|
70 |
-
)
|
71 |
-
|
72 |
-
def _split_generators(self, dl_manager):
|
73 |
-
|
74 |
-
metadata_train=dl_manager.download_and_extract(_METADATA_TRAIN)
|
75 |
-
|
76 |
-
tars_train=dl_manager.download_and_extract(_TARS_TRAIN)
|
77 |
-
|
78 |
-
hash_tar_files=defaultdict(dict)
|
79 |
-
|
80 |
-
with open(tars_train,'r') as f:
|
81 |
-
hash_tar_files['train']=[path.replace('\n','') for path in f]
|
82 |
-
|
83 |
-
hash_meta_paths={"train":metadata_train}
|
84 |
-
audio_paths = dl_manager.download(hash_tar_files)
|
85 |
-
|
86 |
-
splits=["train"]
|
87 |
-
local_extracted_audio_paths = (
|
88 |
-
dl_manager.extract(audio_paths) if not dl_manager.is_streaming else
|
89 |
-
{
|
90 |
-
split:[None] * len(audio_paths[split]) for split in splits
|
91 |
-
}
|
92 |
-
)
|
93 |
-
|
94 |
-
return [
|
95 |
-
datasets.SplitGenerator(
|
96 |
-
name=datasets.Split.TRAIN,
|
97 |
-
gen_kwargs={
|
98 |
-
"audio_archives": [dl_manager.iter_archive(archive) for archive in audio_paths["train"]],
|
99 |
-
"local_extracted_archives_paths": local_extracted_audio_paths["train"],
|
100 |
-
"metadata_paths": hash_meta_paths["train"],
|
101 |
-
}
|
102 |
-
),
|
103 |
-
]
|
104 |
-
|
105 |
-
def _generate_examples(self, audio_archives, local_extracted_archives_paths, metadata_paths):
|
106 |
-
|
107 |
-
features = ["speaker_id","gender","duration","normalized_text"]
|
108 |
-
|
109 |
-
with open(metadata_paths) as f:
|
110 |
-
metadata = {x["audio_id"]: x for x in csv.DictReader(f, delimiter="\t")}
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
for audio_archive, local_extracted_archive_path in zip(audio_archives, local_extracted_archives_paths):
|
115 |
-
for audio_filename, audio_file in audio_archive:
|
116 |
-
audio_id =os.path.splitext(os.path.basename(audio_filename))[0]
|
117 |
-
path = os.path.join(local_extracted_archive_path, audio_filename) if local_extracted_archive_path else audio_filename
|
118 |
-
|
119 |
-
yield audio_id, {
|
120 |
-
"audio_id": audio_id,
|
121 |
-
**{feature: metadata[audio_id][feature] for feature in features},
|
122 |
-
"audio": {"path": path, "bytes": audio_file.read()},
|
123 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
corpus/speech/train.tar.gz → tele_con_ciencia/train-00000-of-00005.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1612cc52da83967c52380b4f3a526f88ce8594977ebd8ba1e8880385e473e4a9
|
3 |
+
size 409831109
|
tele_con_ciencia/train-00001-of-00005.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b324359e4a21bb49037456ad74411de3add44956f4c35739405f3309dd40bd1f
|
3 |
+
size 402470190
|
tele_con_ciencia/train-00002-of-00005.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:22b6e39268bc9eb551b5a265e831cf40bb000b6350f3bff56ec41e440542f8d5
|
3 |
+
size 422519962
|
tele_con_ciencia/train-00003-of-00005.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cac9d8ce467d331691bfb908f170d7f4df75ec08aba7713f9c694767ce5d5926
|
3 |
+
size 405617086
|
tele_con_ciencia/train-00004-of-00005.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:395bb1bb49b5814d2d228a30581d1ddcdfdf0f709a505982faf0a9459bdec4f4
|
3 |
+
size 401207046
|