Datasets:
| """ | |
| 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}") |