system HF staff commited on
Commit
73b922d
·
1 Parent(s): c385d9f

Update files from the datasets library (from 1.13.3)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.13.3

Files changed (2) hide show
  1. README.md +7 -0
  2. vivos.py +2 -0
README.md CHANGED
@@ -86,13 +86,20 @@ A typical data point comprises the path to the audio file, called `path` and its
86
  ```
87
  {'speaker_id': 'VIVOSSPK01',
88
  'path': '/home/admin/.cache/huggingface/datasets/downloads/extracted/b7ded9969e09942ab65313e691e6fc2e12066192ee8527e21d634aca128afbe2/vivos/train/waves/VIVOSSPK01/VIVOSSPK01_R001.wav',
 
 
 
89
  'sentence': 'KHÁCH SẠN'}
90
  ```
91
 
92
  ### Data Fields
93
 
94
  - speaker_id: An id for which speaker (voice) made the recording
 
95
  - path: The path to the audio file
 
 
 
96
  - sentence: The sentence the user was prompted to speak
97
 
98
  ### Data Splits
 
86
  ```
87
  {'speaker_id': 'VIVOSSPK01',
88
  'path': '/home/admin/.cache/huggingface/datasets/downloads/extracted/b7ded9969e09942ab65313e691e6fc2e12066192ee8527e21d634aca128afbe2/vivos/train/waves/VIVOSSPK01/VIVOSSPK01_R001.wav',
89
+ 'audio': {'path': '/home/admin/.cache/huggingface/datasets/downloads/extracted/b7ded9969e09942ab65313e691e6fc2e12066192ee8527e21d634aca128afbe2/vivos/train/waves/VIVOSSPK01/VIVOSSPK01_R001.wav',
90
+ 'array': array([-0.00048828, -0.00018311, -0.00137329, ..., 0.00079346, 0.00091553, 0.00085449], dtype=float32),
91
+ 'sampling_rate': 16000},
92
  'sentence': 'KHÁCH SẠN'}
93
  ```
94
 
95
  ### Data Fields
96
 
97
  - speaker_id: An id for which speaker (voice) made the recording
98
+
99
  - path: The path to the audio file
100
+
101
+ - audio: A dictionary containing the path to the downloaded audio file, the decoded audio array, and the sampling rate. Note that when accessing the audio column: `dataset[0]["audio"]` the audio file is automatically decoded and resampled to `dataset.features["audio"].sampling_rate`. Decoding and resampling of a large number of audio files might take a significant amount of time. Thus it is important to first query the sample index before the `"audio"` column, *i.e.* `dataset[0]["audio"]` should **always** be preferred over `dataset["audio"][0]`.
102
+
103
  - sentence: The sentence the user was prompted to speak
104
 
105
  ### Data Splits
vivos.py CHANGED
@@ -63,6 +63,7 @@ class VivosDataset(datasets.GeneratorBasedBuilder):
63
  {
64
  "speaker_id": datasets.Value("string"),
65
  "path": datasets.Value("string"),
 
66
  "sentence": datasets.Value("string"),
67
  }
68
  ),
@@ -119,5 +120,6 @@ class VivosDataset(datasets.GeneratorBasedBuilder):
119
  yield id_, {
120
  "speaker_id": speaker_id,
121
  "path": os.path.join(path_to_clips, speaker_id, data[0] + ".wav"),
 
122
  "sentence": data[1],
123
  }
 
63
  {
64
  "speaker_id": datasets.Value("string"),
65
  "path": datasets.Value("string"),
66
+ "audio": datasets.features.Audio(sampling_rate=16_000),
67
  "sentence": datasets.Value("string"),
68
  }
69
  ),
 
120
  yield id_, {
121
  "speaker_id": speaker_id,
122
  "path": os.path.join(path_to_clips, speaker_id, data[0] + ".wav"),
123
+ "audio": os.path.join(path_to_clips, speaker_id, data[0] + ".wav"),
124
  "sentence": data[1],
125
  }