freococo commited on
Commit
0832f9a
·
verified ·
1 Parent(s): ff6ef4d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +8 -8
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 now a top-level feature for easy access!
133
  print(f"🎙️ Transcript: {sample['txt']}")
134
 
135
- # The audio can be accessed directly as a NumPy array
136
- audio_array = sample['audio']['array']
137
- sampling_rate = sample['audio']['sampling_rate']
 
138
  print(f"🎧 Audio loaded with shape {audio_array.shape} and rate {sampling_rate} Hz")
139
 
140
- # The full metadata is still available in the JSON string
141
- metadata = json.loads(sample['json'])
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("---")