carlosdanielhernandezmena commited on
Commit
5621468
1 Parent(s): 5fba8ab

Convert dataset to Parquet (#1)

Browse files

- Convert dataset to Parquet (265ff400d54441d1fb7d94ad627ffcfe858ec158)
- Delete data file (8aae0f45b2aeda76776e2311805301e2e5fcae7b)
- Delete data file (2ea7c80313782a93081bfd5699ed4b1e4170346f)
- Delete loading script (41b33114fcfc62c9404f661056a067904d5a5ec5)
- Delete data file (9bba691898ca4306f59a10e41fc83cb869471316)

README.md CHANGED
@@ -1,3 +1,34 @@
1
  ---
2
  license: cc-by-nc-nd-4.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
1
  ---
2
  license: cc-by-nc-nd-4.0
3
+ dataset_info:
4
+ config_name: dimex100_light
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: utterance_type
15
+ dtype: string
16
+ - name: gender
17
+ dtype: string
18
+ - name: duration
19
+ dtype: float32
20
+ - name: normalized_text
21
+ dtype: string
22
+ splits:
23
+ - name: train
24
+ num_bytes: 495948632.083
25
+ num_examples: 5999
26
+ download_size: 459945384
27
+ dataset_size: 495948632.083
28
+ configs:
29
+ - config_name: dimex100_light
30
+ data_files:
31
+ - split: train
32
+ path: dimex100_light/train-*
33
+ default: true
34
  ---
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
 
 
dimex100_light.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="dimex100_light"
8
- _VERSION="1.0.0"
9
-
10
- _DESCRIPTION = """
11
- The DIMEx100 LIGHT Corpus is a reduced version of the DIMEx100 Adult Corpus,
12
- with the aim of facilitating the use of the DIMEx100 Corpus in various automatic
13
- speech recognition systems. DIMEx100 Adult Corpus was created by Dr. Luis Pineda
14
- from UNAM University at Mexico City.
15
- """
16
-
17
- _CITATION = """
18
- @misc{menadimex100light2017,
19
- title={DIMEx100 LIGHT CORPUS: Reduced version of the DIMEx100 Adult Corpus by Dr. Luis Pineda from UNAM University (Mexico).},
20
- author={Hernandez Mena, Carlos Daniel},
21
- year={2017},
22
- url={https://huggingface.co/datasets/carlosdanielhernandezmena/dimex100_light},
23
- }
24
- """
25
-
26
- _HOMEPAGE = "https://huggingface.co/datasets/carlosdanielhernandezmena/dimex100_light"
27
-
28
- _LICENSE = "CC-BY-NC-ND-4.0, See https://creativecommons.org/licenses/by-nc-nd/4.0/deed.en"
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 Dimex100LightConfig(datasets.BuilderConfig):
36
- """BuilderConfig for DIMEx100 LIGHT CORPUS"""
37
-
38
- def __init__(self, name, **kwargs):
39
- name=_NAME
40
- super().__init__(name=name, **kwargs)
41
-
42
- class Dimex100Light(datasets.GeneratorBasedBuilder):
43
- """DIMEx100 LIGHT CORPUS"""
44
-
45
- VERSION = datasets.Version(_VERSION)
46
- BUILDER_CONFIGS = [
47
- Dimex100LightConfig(
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
- "utterance_type": 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","utterance_type","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 → dimex100_light/train-00000-of-00001.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0b6ff7110cabd4136df0a2f78e5c1cc24536d717acaa0657b3f7fd5c43d5531f
3
- size 460404392
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99f95fff29bab03d0bb33ae27c68eef06d60e5b755fed5774cb64373bbc4379d
3
+ size 459945384