wangshaojia commited on
Commit
a5e570d
·
1 Parent(s): 92b4733

first commit

Browse files
Files changed (5) hide show
  1. .gitattributes +2 -29
  2. README-en.md +227 -0
  3. README.md +3 -0
  4. dataset_infos.json +1 -0
  5. vctk.py +144 -0
.gitattributes CHANGED
@@ -1,54 +1,27 @@
1
  *.7z filter=lfs diff=lfs merge=lfs -text
2
  *.arrow filter=lfs diff=lfs merge=lfs -text
3
  *.bin filter=lfs diff=lfs merge=lfs -text
 
4
  *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
  *.ftz filter=lfs diff=lfs merge=lfs -text
7
  *.gz filter=lfs diff=lfs merge=lfs -text
8
  *.h5 filter=lfs diff=lfs merge=lfs -text
9
  *.joblib filter=lfs diff=lfs merge=lfs -text
10
  *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.lz4 filter=lfs diff=lfs merge=lfs -text
12
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
13
  *.model filter=lfs diff=lfs merge=lfs -text
14
  *.msgpack filter=lfs diff=lfs merge=lfs -text
15
- *.npy filter=lfs diff=lfs merge=lfs -text
16
- *.npz filter=lfs diff=lfs merge=lfs -text
17
  *.onnx filter=lfs diff=lfs merge=lfs -text
18
  *.ot filter=lfs diff=lfs merge=lfs -text
19
  *.parquet filter=lfs diff=lfs merge=lfs -text
20
  *.pb filter=lfs diff=lfs merge=lfs -text
21
- *.pickle filter=lfs diff=lfs merge=lfs -text
22
- *.pkl filter=lfs diff=lfs merge=lfs -text
23
  *.pt filter=lfs diff=lfs merge=lfs -text
24
  *.pth filter=lfs diff=lfs merge=lfs -text
25
  *.rar filter=lfs diff=lfs merge=lfs -text
26
- *.safetensors filter=lfs diff=lfs merge=lfs -text
27
  saved_model/**/* filter=lfs diff=lfs merge=lfs -text
28
  *.tar.* filter=lfs diff=lfs merge=lfs -text
29
  *.tflite filter=lfs diff=lfs merge=lfs -text
30
  *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
  *.xz filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
- # Audio files - uncompressed
37
- *.pcm filter=lfs diff=lfs merge=lfs -text
38
- *.sam filter=lfs diff=lfs merge=lfs -text
39
- *.raw filter=lfs diff=lfs merge=lfs -text
40
- # Audio files - compressed
41
- *.aac filter=lfs diff=lfs merge=lfs -text
42
- *.flac filter=lfs diff=lfs merge=lfs -text
43
- *.mp3 filter=lfs diff=lfs merge=lfs -text
44
- *.ogg filter=lfs diff=lfs merge=lfs -text
45
- *.wav filter=lfs diff=lfs merge=lfs -text
46
- # Image files - uncompressed
47
- *.bmp filter=lfs diff=lfs merge=lfs -text
48
- *.gif filter=lfs diff=lfs merge=lfs -text
49
- *.png filter=lfs diff=lfs merge=lfs -text
50
- *.tiff filter=lfs diff=lfs merge=lfs -text
51
- # Image files - compressed
52
- *.jpg filter=lfs diff=lfs merge=lfs -text
53
- *.jpeg filter=lfs diff=lfs merge=lfs -text
54
- *.webp filter=lfs diff=lfs merge=lfs -text
 
1
  *.7z filter=lfs diff=lfs merge=lfs -text
2
  *.arrow filter=lfs diff=lfs merge=lfs -text
3
  *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
5
  *.bz2 filter=lfs diff=lfs merge=lfs -text
 
6
  *.ftz filter=lfs diff=lfs merge=lfs -text
7
  *.gz filter=lfs diff=lfs merge=lfs -text
8
  *.h5 filter=lfs diff=lfs merge=lfs -text
9
  *.joblib filter=lfs diff=lfs merge=lfs -text
10
  *.lfs.* filter=lfs diff=lfs merge=lfs -text
 
 
11
  *.model filter=lfs diff=lfs merge=lfs -text
12
  *.msgpack filter=lfs diff=lfs merge=lfs -text
 
 
13
  *.onnx filter=lfs diff=lfs merge=lfs -text
14
  *.ot filter=lfs diff=lfs merge=lfs -text
15
  *.parquet filter=lfs diff=lfs merge=lfs -text
16
  *.pb filter=lfs diff=lfs merge=lfs -text
 
 
17
  *.pt filter=lfs diff=lfs merge=lfs -text
18
  *.pth filter=lfs diff=lfs merge=lfs -text
19
  *.rar filter=lfs diff=lfs merge=lfs -text
 
20
  saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
  *.tar.* filter=lfs diff=lfs merge=lfs -text
22
  *.tflite filter=lfs diff=lfs merge=lfs -text
23
  *.tgz filter=lfs diff=lfs merge=lfs -text
 
24
  *.xz filter=lfs diff=lfs merge=lfs -text
25
  *.zip filter=lfs diff=lfs merge=lfs -text
26
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
27
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README-en.md ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - expert-generated
4
+ language_creators:
5
+ - crowdsourced
6
+ language:
7
+ - en
8
+ license:
9
+ - cc-by-4.0
10
+ multilinguality:
11
+ - monolingual
12
+ pretty_name: VCTK
13
+ size_categories:
14
+ - 10K<n<100K
15
+ source_datasets:
16
+ - original
17
+ task_categories:
18
+ - automatic-speech-recognition
19
+ task_ids: []
20
+ paperswithcode_id: vctk
21
+ train-eval-index:
22
+ - config: main
23
+ task: automatic-speech-recognition
24
+ task_id: speech_recognition
25
+ splits:
26
+ train_split: train
27
+ col_mapping:
28
+ file: path
29
+ text: text
30
+ metrics:
31
+ - type: wer
32
+ name: WER
33
+ - type: cer
34
+ name: CER
35
+ dataset_info:
36
+ features:
37
+ - name: speaker_id
38
+ dtype: string
39
+ - name: audio
40
+ dtype:
41
+ audio:
42
+ sampling_rate: 48000
43
+ - name: file
44
+ dtype: string
45
+ - name: text
46
+ dtype: string
47
+ - name: text_id
48
+ dtype: string
49
+ - name: age
50
+ dtype: string
51
+ - name: gender
52
+ dtype: string
53
+ - name: accent
54
+ dtype: string
55
+ - name: region
56
+ dtype: string
57
+ - name: comment
58
+ dtype: string
59
+ config_name: main
60
+ splits:
61
+ - name: train
62
+ num_bytes: 40103111
63
+ num_examples: 88156
64
+ download_size: 11747302977
65
+ dataset_size: 40103111
66
+ ---
67
+
68
+ # Dataset Card for VCTK
69
+
70
+ ## Table of Contents
71
+ - [Dataset Description](#dataset-description)
72
+ - [Dataset Summary](#dataset-summary)
73
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
74
+ - [Languages](#languages)
75
+ - [Dataset Structure](#dataset-structure)
76
+ - [Data Instances](#data-instances)
77
+ - [Data Fields](#data-fields)
78
+ - [Data Splits](#data-splits)
79
+ - [Dataset Creation](#dataset-creation)
80
+ - [Curation Rationale](#curation-rationale)
81
+ - [Source Data](#source-data)
82
+ - [Annotations](#annotations)
83
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
84
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
85
+ - [Social Impact of Dataset](#social-impact-of-dataset)
86
+ - [Discussion of Biases](#discussion-of-biases)
87
+ - [Other Known Limitations](#other-known-limitations)
88
+ - [Additional Information](#additional-information)
89
+ - [Dataset Curators](#dataset-curators)
90
+ - [Licensing Information](#licensing-information)
91
+ - [Citation Information](#citation-information)
92
+ - [Contributions](#contributions)
93
+
94
+ ## Dataset Description
95
+
96
+ - **Homepage:** [Edinburg DataShare](https://doi.org/10.7488/ds/2645)
97
+ - **Repository:**
98
+ - **Paper:**
99
+ - **Leaderboard:**
100
+ - **Point of Contact:**
101
+
102
+ ### Dataset Summary
103
+
104
+ This CSTR VCTK Corpus includes speech data uttered by 110 English speakers with various accents. Each speaker reads out about 400 sentences, which were selected from a newspaper, the rainbow passage and an elicitation paragraph used for the speech accent archive.
105
+
106
+ ### Supported Tasks and Leaderboards
107
+
108
+ [More Information Needed]
109
+
110
+ ### Languages
111
+
112
+ [More Information Needed]
113
+
114
+ ## Dataset Structure
115
+
116
+ ### Data Instances
117
+
118
+ A data point comprises the path to the audio file, called `file` and its transcription, called `text`.
119
+
120
+ ```
121
+ {
122
+ 'speaker_id': 'p225',
123
+ 'text_id': '001',
124
+ 'text': 'Please call Stella.',
125
+ 'age': '23',
126
+ 'gender': 'F',
127
+ 'accent': 'English',
128
+ 'region': 'Southern England',
129
+ 'file': '/datasets/downloads/extracted/8ed7dad05dfffdb552a3699777442af8e8ed11e656feb277f35bf9aea448f49e/wav48_silence_trimmed/p225/p225_001_mic1.flac',
130
+ 'audio':
131
+ {
132
+ 'path': '/datasets/downloads/extracted/8ed7dad05dfffdb552a3699777442af8e8ed11e656feb277f35bf9aea448f49e/wav48_silence_trimmed/p225/p225_001_mic1.flac',
133
+ 'array': array([0.00485229, 0.00689697, 0.00619507, ..., 0.00811768, 0.00836182, 0.00854492], dtype=float32),
134
+ 'sampling_rate': 48000
135
+ },
136
+ 'comment': ''
137
+ }
138
+ ```
139
+
140
+ Each audio file is a single-channel FLAC with a sample rate of 48000 Hz.
141
+
142
+ ### Data Fields
143
+
144
+ Each row consists of the following fields:
145
+
146
+ - `speaker_id`: Speaker ID
147
+ - `audio`: Audio recording
148
+ - `file`: Path to audio file
149
+ - `text`: Text transcription of corresponding audio
150
+ - `text_id`: Text ID
151
+ - `age`: Speaker's age
152
+ - `gender`: Speaker's gender
153
+ - `accent`: Speaker's accent
154
+ - `region`: Speaker's region, if annotation exists
155
+ - `comment`: Miscellaneous comments, if any
156
+
157
+ ### Data Splits
158
+
159
+ The dataset has no predefined splits.
160
+
161
+ ## Dataset Creation
162
+
163
+ ### Curation Rationale
164
+
165
+ [More Information Needed]
166
+
167
+ ### Source Data
168
+
169
+ #### Initial Data Collection and Normalization
170
+
171
+ [More Information Needed]
172
+
173
+ #### Who are the source language producers?
174
+
175
+ [More Information Needed]
176
+
177
+ ### Annotations
178
+
179
+ #### Annotation process
180
+
181
+ [More Information Needed]
182
+
183
+ #### Who are the annotators?
184
+
185
+ [More Information Needed]
186
+
187
+ ### Personal and Sensitive Information
188
+
189
+ The dataset consists of people who have donated their voice online. You agree to not attempt to determine the identity of speakers in this dataset.
190
+
191
+ ## Considerations for Using the Data
192
+
193
+ ### Social Impact of Dataset
194
+
195
+ [More Information Needed]
196
+
197
+ ### Discussion of Biases
198
+
199
+ [More Information Needed]
200
+
201
+ ### Other Known Limitations
202
+
203
+ [More Information Needed]
204
+
205
+ ## Additional Information
206
+
207
+ ### Dataset Curators
208
+
209
+ [More Information Needed]
210
+
211
+ ### Licensing Information
212
+
213
+ Public Domain, Creative Commons Attribution 4.0 International Public License ([CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode))
214
+
215
+ ### Citation Information
216
+
217
+ ```bibtex
218
+ @inproceedings{Veaux2017CSTRVC,
219
+ title = {CSTR VCTK Corpus: English Multi-speaker Corpus for CSTR Voice Cloning Toolkit},
220
+ author = {Christophe Veaux and Junichi Yamagishi and Kirsten MacDonald},
221
+ year = 2017
222
+ }
223
+ ```
224
+
225
+ ### Contributions
226
+
227
+ Thanks to [@jaketae](https://github.com/jaketae) for adding this dataset.
README.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+
2
+ copy from https://huggingface.co/datasets/vctk
3
+ and support set data_files
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"main": {"description": "", "citation": "@inproceedings{Veaux2017CSTRVC,\n\ttitle = {CSTR VCTK Corpus: English Multi-speaker Corpus for CSTR Voice Cloning Toolkit},\n\tauthor = {Christophe Veaux and Junichi Yamagishi and Kirsten MacDonald},\n\tyear = 2017\n}\n", "homepage": "https://datashare.ed.ac.uk/handle/10283/3443", "license": "", "features": {"speaker_id": {"dtype": "string", "id": null, "_type": "Value"}, "audio": {"sampling_rate": 48000, "mono": true, "_storage_dtype": "string", "id": null, "_type": "Audio"}, "file": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "text_id": {"dtype": "string", "id": null, "_type": "Value"}, "age": {"dtype": "string", "id": null, "_type": "Value"}, "gender": {"dtype": "string", "id": null, "_type": "Value"}, "accent": {"dtype": "string", "id": null, "_type": "Value"}, "region": {"dtype": "string", "id": null, "_type": "Value"}, "comment": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": {"input": "file", "output": "text"}, "task_templates": [{"task": "automatic-speech-recognition", "audio_column": "audio", "transcription_column": "text"}], "builder_name": "vctk", "config_name": "main", "version": {"version_str": "0.9.2", "description": null, "major": 0, "minor": 9, "patch": 2}, "splits": {"train": {"name": "train", "num_bytes": 40103111, "num_examples": 88156, "dataset_name": "vctk"}}, "download_checksums": {"https://datashare.is.ed.ac.uk/bitstream/handle/10283/3443/VCTK-Corpus-0.92.zip": {"num_bytes": 11747302977, "checksum": "f96258be9fdc2cbff6559541aae7ea4f59df3fcaf5cf963aae5ca647357e359c"}}, "download_size": 11747302977, "post_processing_size": null, "dataset_size": 40103111, "size_in_bytes": 11787406088}}
vctk.py ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2021 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ # Lint as: python3
17
+ """VCTK dataset."""
18
+
19
+
20
+ import os
21
+ import re
22
+
23
+ import datasets
24
+ from datasets.tasks import AutomaticSpeechRecognition
25
+
26
+
27
+ _CITATION = """\
28
+ @inproceedings{Veaux2017CSTRVC,
29
+ title = {CSTR VCTK Corpus: English Multi-speaker Corpus for CSTR Voice Cloning Toolkit},
30
+ author = {Christophe Veaux and Junichi Yamagishi and Kirsten MacDonald},
31
+ year = 2017
32
+ }
33
+ """
34
+
35
+ _DESCRIPTION = """\
36
+ The CSTR VCTK Corpus includes speech data uttered by 110 English speakers with various accents.
37
+ """
38
+
39
+ _URL = "https://datashare.ed.ac.uk/handle/10283/3443"
40
+ _DL_URL = "https://datashare.is.ed.ac.uk/bitstream/handle/10283/3443/VCTK-Corpus-0.92.zip"
41
+
42
+
43
+ class VCTK(datasets.GeneratorBasedBuilder):
44
+ """VCTK dataset."""
45
+
46
+ VERSION = datasets.Version("0.9.2")
47
+
48
+ BUILDER_CONFIGS = [
49
+ datasets.BuilderConfig(name="main", version=VERSION,
50
+ description="VCTK dataset"),
51
+ ]
52
+
53
+ def _info(self):
54
+ return datasets.DatasetInfo(
55
+ description=_DESCRIPTION,
56
+ features=datasets.Features(
57
+ {
58
+ "speaker_id": datasets.Value("string"),
59
+ "audio": datasets.features.Audio(sampling_rate=48_000),
60
+ "file": datasets.Value("string"),
61
+ "text": datasets.Value("string"),
62
+ "text_id": datasets.Value("string"),
63
+ "age": datasets.Value("string"),
64
+ "gender": datasets.Value("string"),
65
+ "accent": datasets.Value("string"),
66
+ "region": datasets.Value("string"),
67
+ "comment": datasets.Value("string"),
68
+ }
69
+ ),
70
+ supervised_keys=("file", "text"),
71
+ homepage=_URL,
72
+ citation=_CITATION,
73
+ task_templates=[AutomaticSpeechRecognition(
74
+ audio_column="audio", transcription_column="text")],
75
+ )
76
+
77
+ def _split_generators(self, dl_manager):
78
+ if self.config.data_files:
79
+ root_path = self.config.data_files
80
+ else:
81
+ root_path = _DL_URL
82
+ root_path = dl_manager.download_and_extract(root_path)
83
+
84
+ if isinstance(root_path,dict):
85
+ root_path = root_path['train'][0]
86
+
87
+ return [
88
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={
89
+ "root_path": root_path}),
90
+ ]
91
+
92
+ def _generate_examples(self, root_path):
93
+ """Generate examples from the VCTK corpus root path."""
94
+
95
+ meta_path = os.path.join(root_path, "speaker-info.txt")
96
+ txt_root = os.path.join(root_path, "txt")
97
+ wav_root = os.path.join(root_path, "wav48_silence_trimmed")
98
+ # NOTE: "comment" is handled separately in logic below
99
+ fields = ["speaker_id", "age", "gender", "accent", "region"]
100
+
101
+ key = 0
102
+ with open(meta_path, encoding="utf-8") as meta_file:
103
+ _ = next(iter(meta_file))
104
+ for line in meta_file:
105
+ data = {}
106
+ line = line.strip()
107
+ search = re.search(r"\(.*\)", line)
108
+ if search is None:
109
+ data["comment"] = ""
110
+ else:
111
+ start, _ = search.span()
112
+ data["comment"] = line[start:]
113
+ line = line[:start]
114
+ values = line.split()
115
+ for i, field in enumerate(fields):
116
+ if field == "region":
117
+ data[field] = " ".join(values[i:])
118
+ else:
119
+ data[field] = values[i] if i < len(values) else ""
120
+ speaker_id = data["speaker_id"]
121
+ speaker_txt_path = os.path.join(txt_root, speaker_id)
122
+ speaker_wav_path = os.path.join(wav_root, speaker_id)
123
+ # NOTE: p315 does not have text
124
+ if not os.path.exists(speaker_txt_path):
125
+ continue
126
+ for txt_file in sorted(os.listdir(speaker_txt_path)):
127
+ filename, _ = os.path.splitext(txt_file)
128
+ _, text_id = filename.split("_")
129
+ for i in [1, 2]:
130
+ wav_file = os.path.join(
131
+ speaker_wav_path, f"{filename}_mic{i}.flac")
132
+ # NOTE: p280 does not have mic2 files
133
+ if not os.path.exists(wav_file):
134
+ continue
135
+ with open(os.path.join(speaker_txt_path, txt_file), encoding="utf-8") as text_file:
136
+ text = text_file.readline().strip()
137
+ more_data = {
138
+ "file": wav_file,
139
+ "audio": wav_file,
140
+ "text": text,
141
+ "text_id": text_id,
142
+ }
143
+ yield key, {**data, **more_data}
144
+ key += 1