carlosdanielhernandezmena
commited on
Convert dataset to Parquet (#1)
Browse files- Convert dataset to Parquet (68d050d74b4397ea4941ba4eea823d8c39f2e691)
- Delete loading script (d4be9d02aa826aeed417e022d61bcd6d2ec5aeff)
- Delete data file (8c95a1c0b2e178b9ecee3dbbd80a1bf4d61ac156)
- Delete data file (0090de78ee138783e285c1b815ee59adc1c268a8)
- Delete data file (6d3a49ec98d3d331f7ede70083d09d01d458a2ee)
README.md
CHANGED
@@ -1,3 +1,32 @@
|
|
1 |
---
|
2 |
license: cc-by-sa-4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
1 |
---
|
2 |
license: cc-by-sa-4.0
|
3 |
+
dataset_info:
|
4 |
+
config_name: chm150_asr
|
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: 106136396.519
|
23 |
+
num_examples: 2663
|
24 |
+
download_size: 110058240
|
25 |
+
dataset_size: 106136396.519
|
26 |
+
configs:
|
27 |
+
- config_name: chm150_asr
|
28 |
+
data_files:
|
29 |
+
- split: train
|
30 |
+
path: chm150_asr/train-*
|
31 |
+
default: true
|
32 |
---
|
chm150_asr.py
DELETED
@@ -1,122 +0,0 @@
|
|
1 |
-
from collections import defaultdict
|
2 |
-
import os
|
3 |
-
import json
|
4 |
-
import csv
|
5 |
-
import datasets
|
6 |
-
|
7 |
-
_NAME="chm150_asr"
|
8 |
-
_VERSION="1.0.0"
|
9 |
-
|
10 |
-
_DESCRIPTION = """
|
11 |
-
The CHM150 is a corpus of microphone speech of mexican Spanish taken from 75 male speakers and
|
12 |
-
75 female speakers in a noise environment of a "quiet office" with a total duration of 1.63 hours.
|
13 |
-
"""
|
14 |
-
|
15 |
-
_CITATION = """
|
16 |
-
@misc{menachm150asr2016,
|
17 |
-
title={CHM150 CORPUS: Audio and Transcripts in Spanish of 150 speakers from Mexico City.},
|
18 |
-
ldc_catalog_no={LDC2016S04},
|
19 |
-
DOI={https://doi.org/10.35111/ygn0-wm25},
|
20 |
-
author={Hernandez Mena, Carlos Daniel and Herrera Camacho, Jose Abel},
|
21 |
-
journal={Linguistic Data Consortium, Philadelphia},
|
22 |
-
year={2016},
|
23 |
-
url={https://catalog.ldc.upenn.edu/LDC2016S04},
|
24 |
-
}
|
25 |
-
"""
|
26 |
-
|
27 |
-
_HOMEPAGE = "https://catalog.ldc.upenn.edu/LDC2016S04"
|
28 |
-
|
29 |
-
_LICENSE = "CC-BY-SA-4.0, See http://creativecommons.org/licenses/by-sa/4.0/"
|
30 |
-
|
31 |
-
_BASE_DATA_DIR = "corpus/"
|
32 |
-
_METADATA_TRAIN = os.path.join(_BASE_DATA_DIR,"files", "metadata_train.tsv")
|
33 |
-
|
34 |
-
_TARS_TRAIN = os.path.join(_BASE_DATA_DIR,"files", "tars_train.paths")
|
35 |
-
|
36 |
-
class CHM150Config(datasets.BuilderConfig):
|
37 |
-
"""BuilderConfig for CHM150 CORPUS"""
|
38 |
-
|
39 |
-
def __init__(self, name, **kwargs):
|
40 |
-
name=_NAME
|
41 |
-
super().__init__(name=name, **kwargs)
|
42 |
-
|
43 |
-
class CHM150(datasets.GeneratorBasedBuilder):
|
44 |
-
"""CHM150 CORPUS"""
|
45 |
-
|
46 |
-
VERSION = datasets.Version(_VERSION)
|
47 |
-
BUILDER_CONFIGS = [
|
48 |
-
CHM150Config(
|
49 |
-
name=_NAME,
|
50 |
-
version=datasets.Version(_VERSION),
|
51 |
-
)
|
52 |
-
]
|
53 |
-
|
54 |
-
def _info(self):
|
55 |
-
features = datasets.Features(
|
56 |
-
{
|
57 |
-
"audio_id": datasets.Value("string"),
|
58 |
-
"audio": datasets.Audio(sampling_rate=16000),
|
59 |
-
"speaker_id": datasets.Value("string"),
|
60 |
-
"gender": datasets.Value("string"),
|
61 |
-
"duration": datasets.Value("float32"),
|
62 |
-
"normalized_text": datasets.Value("string"),
|
63 |
-
}
|
64 |
-
)
|
65 |
-
return datasets.DatasetInfo(
|
66 |
-
description=_DESCRIPTION,
|
67 |
-
features=features,
|
68 |
-
homepage=_HOMEPAGE,
|
69 |
-
license=_LICENSE,
|
70 |
-
citation=_CITATION,
|
71 |
-
)
|
72 |
-
|
73 |
-
def _split_generators(self, dl_manager):
|
74 |
-
|
75 |
-
metadata_train=dl_manager.download_and_extract(_METADATA_TRAIN)
|
76 |
-
|
77 |
-
tars_train=dl_manager.download_and_extract(_TARS_TRAIN)
|
78 |
-
|
79 |
-
hash_tar_files=defaultdict(dict)
|
80 |
-
|
81 |
-
with open(tars_train,'r') as f:
|
82 |
-
hash_tar_files['train']=[path.replace('\n','') for path in f]
|
83 |
-
|
84 |
-
hash_meta_paths={"train":metadata_train}
|
85 |
-
audio_paths = dl_manager.download(hash_tar_files)
|
86 |
-
|
87 |
-
splits=["train"]
|
88 |
-
local_extracted_audio_paths = (
|
89 |
-
dl_manager.extract(audio_paths) if not dl_manager.is_streaming else
|
90 |
-
{
|
91 |
-
split:[None] * len(audio_paths[split]) for split in splits
|
92 |
-
}
|
93 |
-
)
|
94 |
-
|
95 |
-
return [
|
96 |
-
datasets.SplitGenerator(
|
97 |
-
name=datasets.Split.TRAIN,
|
98 |
-
gen_kwargs={
|
99 |
-
"audio_archives": [dl_manager.iter_archive(archive) for archive in audio_paths["train"]],
|
100 |
-
"local_extracted_archives_paths": local_extracted_audio_paths["train"],
|
101 |
-
"metadata_paths": hash_meta_paths["train"],
|
102 |
-
}
|
103 |
-
),
|
104 |
-
]
|
105 |
-
|
106 |
-
def _generate_examples(self, audio_archives, local_extracted_archives_paths, metadata_paths):
|
107 |
-
|
108 |
-
features = ["speaker_id","gender","duration","normalized_text"]
|
109 |
-
|
110 |
-
with open(metadata_paths) as f:
|
111 |
-
metadata = {x["audio_id"]: x for x in csv.DictReader(f, delimiter="\t")}
|
112 |
-
|
113 |
-
for audio_archive, local_extracted_archive_path in zip(audio_archives, local_extracted_archives_paths):
|
114 |
-
for audio_filename, audio_file in audio_archive:
|
115 |
-
audio_id =os.path.splitext(os.path.basename(audio_filename))[0]
|
116 |
-
path = os.path.join(local_extracted_archive_path, audio_filename) if local_extracted_archive_path else audio_filename
|
117 |
-
|
118 |
-
yield audio_id, {
|
119 |
-
"audio_id": audio_id,
|
120 |
-
**{feature: metadata[audio_id][feature] for feature in features},
|
121 |
-
"audio": {"path": path, "bytes": audio_file.read()},
|
122 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
corpus/speech/train.tar.gz → chm150_asr/train-00000-of-00001.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:f4a516b4bb69050897457428907f5df1c04ad89901aa83340ad68b68c05e7fe5
|
3 |
+
size 110058240
|
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
|
|
|
|