Datasets:
| from datasets import load_dataset | |
| import numpy as np | |
| # Path to your new parquet directory | |
| parquet_dir = "/opt/gpfs/home/leying/data/data/DeepASMR_dataset/parquet" | |
| print("Loading dataset from sharded Parquet files...") | |
| # We use a wildcard to load all shards at once | |
| dataset = load_dataset("parquet", data_files=f"{parquet_dir}/*.parquet", split="train") | |
| print(f"Dataset loaded successfully!") | |
| print(f"Total number of utterances: {len(dataset)}") | |
| # --- Test a random sample --- | |
| sample_idx = 0 | |
| sample = dataset[sample_idx] | |
| print("\n--- Sample Check ---") | |
| print(f"Transcript: {sample['transcript']}") | |
| print(f"Speaker ID: {sample['speaker_id']}") | |
| print(f"Language: {sample['language']}") | |
| # This part tests if the audio bytes actually decode into a waveform | |
| audio_array = sample['audio']['array'] | |
| sampling_rate = sample['audio']['sampling_rate'] | |
| print(f"Audio Shape: {audio_array.shape}") | |
| print(f"Sampling Rate: {sampling_rate} Hz") | |
| print(f"Duration: {len(audio_array) / sampling_rate:.2f} seconds") | |
| # Optional: Check if the data is non-zero (proves it's not just silence/empty) | |
| if np.abs(audio_array).max() > 0: | |
| print("Status: Audio data is valid and non-silent.") | |
| else: | |
| print("Status: Warning - Audio data appears to be empty/silent.")oooo rclone size deepasmr:deepasmr-transfer-2026/DeepASMR-DB |