Update libriheavy.py
Browse files- libriheavy.py +26 -26
libriheavy.py
CHANGED
|
@@ -203,30 +203,30 @@ class Libriheavy(datasets.GeneratorBasedBuilder):
|
|
| 203 |
utterance_id = sorted(list(text.keys()))[-1]
|
| 204 |
utterance = text[utterance_id]
|
| 205 |
npz_item = npz[str(utterance_id)].item()
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
yield chunk["speaker_id"] + "_" + utterance_id, result
|
|
|
|
| 203 |
utterance_id = sorted(list(text.keys()))[-1]
|
| 204 |
utterance = text[utterance_id]
|
| 205 |
npz_item = npz[str(utterance_id)].item()
|
| 206 |
+
result = {
|
| 207 |
+
"id": chunk["speaker_id"] + "_" + utterance_id,
|
| 208 |
+
"speaker_id": chunk["speaker_id"],
|
| 209 |
+
"speaker_vec": npz_item["d_vector"],
|
| 210 |
+
"audio": chunk["audio"],
|
| 211 |
+
"text": chunk["text"],
|
| 212 |
+
"word_segments": [
|
| 213 |
+
{"start": segment[0], "end": segment[1], "word": segment[2]} for segment in utterance["word_segments"]
|
| 214 |
+
],
|
| 215 |
+
"phone_segments": [
|
| 216 |
+
{"start": segment[0], "end": segment[1], "phone": segment[2]} for segment in utterance["phone_segments"]
|
| 217 |
+
],
|
| 218 |
+
"mel_spectrogram": npz_item["mel"][0][0],
|
| 219 |
+
"attributes": {
|
| 220 |
+
npz_item["pitch"],
|
| 221 |
+
npz_item["energy"],
|
| 222 |
+
npz_item["snr"],
|
| 223 |
+
npz_item["srmr"],
|
| 224 |
+
},
|
| 225 |
+
"overall_attributes": {
|
| 226 |
+
npz_item["overall_pitch"],
|
| 227 |
+
npz_item["overall_energy"],
|
| 228 |
+
npz_item["overall_snr"],
|
| 229 |
+
npz_item["overall_srmr"],
|
| 230 |
+
},
|
| 231 |
+
}
|
| 232 |
yield chunk["speaker_id"] + "_" + utterance_id, result
|