Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -118,9 +118,8 @@ This is the recommended way to use the dataset, as it avoids downloading all ~5.
|
|
| 118 |
|
| 119 |
```python
|
| 120 |
from datasets import load_dataset
|
| 121 |
-
import json
|
| 122 |
|
| 123 |
-
# The library automatically finds all .tar.gz shards
|
| 124 |
ds = load_dataset(
|
| 125 |
"freococo/media_queen_entertaiment_voices",
|
| 126 |
split="train",
|
|
@@ -129,16 +128,17 @@ ds = load_dataset(
|
|
| 129 |
|
| 130 |
# Iterate through the first 5 samples
|
| 131 |
for sample in ds.take(5):
|
| 132 |
-
# The transcript is
|
| 133 |
print(f"🎙️ Transcript: {sample['txt']}")
|
| 134 |
|
| 135 |
-
# The audio
|
| 136 |
-
|
| 137 |
-
|
|
|
|
| 138 |
print(f"🎧 Audio loaded with shape {audio_array.shape} and rate {sampling_rate} Hz")
|
| 139 |
|
| 140 |
-
# The
|
| 141 |
-
metadata =
|
| 142 |
print(f"📺 Channel: {metadata.get('channel')}")
|
| 143 |
print(f"🎥 Video URL: {metadata.get('video_url')}")
|
| 144 |
print("---")
|
|
|
|
| 118 |
|
| 119 |
```python
|
| 120 |
from datasets import load_dataset
|
|
|
|
| 121 |
|
| 122 |
+
# The library automatically finds all .tar.gz shards in the repo
|
| 123 |
ds = load_dataset(
|
| 124 |
"freococo/media_queen_entertaiment_voices",
|
| 125 |
split="train",
|
|
|
|
| 128 |
|
| 129 |
# Iterate through the first 5 samples
|
| 130 |
for sample in ds.take(5):
|
| 131 |
+
# The transcript is a top-level feature for easy access
|
| 132 |
print(f"🎙️ Transcript: {sample['txt']}")
|
| 133 |
|
| 134 |
+
# The audio data is in the 'mp3' column
|
| 135 |
+
audio_data = sample['mp3']
|
| 136 |
+
audio_array = audio_data['array']
|
| 137 |
+
sampling_rate = audio_data['sampling_rate']
|
| 138 |
print(f"🎧 Audio loaded with shape {audio_array.shape} and rate {sampling_rate} Hz")
|
| 139 |
|
| 140 |
+
# The 'json' column is ALREADY a Python dictionary
|
| 141 |
+
metadata = sample['json']
|
| 142 |
print(f"📺 Channel: {metadata.get('channel')}")
|
| 143 |
print(f"🎥 Video URL: {metadata.get('video_url')}")
|
| 144 |
print("---")
|