File size: 963 Bytes
b734054
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
Example script showing how to load the Pashto Synthetic Speech dataset
"""
from datasets import load_dataset

# Loading from local files
# Replace with your own path if testing locally
dataset = load_dataset("parquet", data_files={"train": "data/shard-00000-of-00001.parquet"})

# Loading from Hugging Face
# dataset = load_dataset("ihanif/pashto-synthetic-speech-3k")

# Access a few examples
for i in range(3):
    example = dataset["train"][i]
    print(f"Example {i}:")
    print(f"  Text: {example['text']}")
    print(f"  Speaker: {example['speaker']}")
    print(f"  Duration: {example['duration']:.2f}s")
    print(f"  Sampling rate: {example['sampling_rate']}")
    print(f"  Audio type: {type(example['audio'])}")
    print(f"  Audio keys: {example['audio'].keys() if isinstance(example['audio'], dict) else 'N/A'}")
    print()

# Basic stats
print(f"Dataset size: {len(dataset['train'])} examples")
print(f"Features: {dataset['train'].features}")