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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- text-generation
|
| 5 |
+
- text-to-speech
|
| 6 |
+
- automatic-speech-recognition
|
| 7 |
+
tags:
|
| 8 |
+
- Urdu
|
| 9 |
+
language:
|
| 10 |
+
- ur
|
| 11 |
+
pretty_name: ' Munch Hashed Index '
|
| 12 |
+
---
|
| 13 |
+
# Munch Hashed Index - Lightweight Audio Reference Dataset
|
| 14 |
+
|
| 15 |
+
[](https://huggingface.co/datasets/humair025/Munch)
|
| 16 |
+
[](https://huggingface.co/datasets/humair025/hashed_data)
|
| 17 |
+
[]()
|
| 18 |
+
[]()
|
| 19 |
+
[]()
|
| 20 |
+
|
| 21 |
+
## π Overview
|
| 22 |
+
|
| 23 |
+
**Munch Hashed Index** is a lightweight reference dataset that provides SHA-256 hashes for all audio files in the [Munch Urdu TTS Dataset](https://huggingface.co/datasets/humair025/Munch). Instead of storing 2.17 TB of raw audio, this index stores only metadata and cryptographic hashes, enabling:
|
| 24 |
+
|
| 25 |
+
- β
**Fast duplicate detection** across 2.5M+ audio samples
|
| 26 |
+
- β
**Efficient dataset exploration** without downloading terabytes
|
| 27 |
+
- β
**Quick metadata queries** (voice distribution, text stats, etc.)
|
| 28 |
+
- β
**Selective audio retrieval** - download only what you need
|
| 29 |
+
- β
**Storage efficiency** - 99.99% space reduction (2.17 TB β ~150 MB)
|
| 30 |
+
|
| 31 |
+
### π Related Datasets
|
| 32 |
+
|
| 33 |
+
- **Original Dataset**: [humair025/Munch](https://huggingface.co/datasets/humair025/Munch) - Full audio dataset (1+ TB)
|
| 34 |
+
- **This Index**: [humair025/hashed_data](https://huggingface.co/datasets/humair025/hashed_data) - Hashed reference (~500 MB)
|
| 35 |
+
|
| 36 |
+
---
|
| 37 |
+
|
| 38 |
+
## π― What Problem Does This Solve?
|
| 39 |
+
|
| 40 |
+
### The Challenge
|
| 41 |
+
The original [Munch dataset](https://huggingface.co/datasets/humair025/Munch) contains:
|
| 42 |
+
- π **2.5M+ audio-text pairs**
|
| 43 |
+
- πΎ **2.17 TB total size**
|
| 44 |
+
- π¦ **5,000+ separate parquet files**
|
| 45 |
+
|
| 46 |
+
This makes it difficult to:
|
| 47 |
+
- β Quickly check if specific audio exists
|
| 48 |
+
- β Find duplicate audio samples
|
| 49 |
+
- β Explore metadata without downloading everything
|
| 50 |
+
- β Work on limited bandwidth/storage
|
| 51 |
+
|
| 52 |
+
### The Solution
|
| 53 |
+
This hashed index provides:
|
| 54 |
+
- β
**All metadata** (text, voice, timestamps) without audio bytes
|
| 55 |
+
- β
**SHA-256 hashes** for every audio file (unique fingerprint)
|
| 56 |
+
- β
**File references** (which parquet contains each audio)
|
| 57 |
+
- β
**Fast queries** - search 2.5M records in seconds
|
| 58 |
+
- β
**Retrieve on demand** - download only specific audio when needed
|
| 59 |
+
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
## π Quick Start
|
| 63 |
+
|
| 64 |
+
### Installation
|
| 65 |
+
|
| 66 |
+
```bash
|
| 67 |
+
pip install datasets pandas
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
### Basic Usage
|
| 71 |
+
|
| 72 |
+
```python
|
| 73 |
+
from datasets import load_dataset
|
| 74 |
+
import pandas as pd
|
| 75 |
+
|
| 76 |
+
# Load the entire hashed index (fast - only ~150 MB!)
|
| 77 |
+
ds = load_dataset("humair025/hashed_data", split="train")
|
| 78 |
+
df = pd.DataFrame(ds)
|
| 79 |
+
|
| 80 |
+
print(f"Total records: {len(df)}")
|
| 81 |
+
print(f"Unique audio hashes: {df['audio_bytes_hash'].nunique()}")
|
| 82 |
+
print(f"Voices: {df['voice'].unique()}")
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
### Find Duplicates
|
| 86 |
+
|
| 87 |
+
```python
|
| 88 |
+
# Check for duplicate audio
|
| 89 |
+
duplicates = df[df.duplicated(subset=['audio_bytes_hash'], keep=False)]
|
| 90 |
+
|
| 91 |
+
if len(duplicates) > 0:
|
| 92 |
+
print(f"β οΈ Found {len(duplicates)} duplicate rows")
|
| 93 |
+
print(f" Unique audio files: {df['audio_bytes_hash'].nunique()}")
|
| 94 |
+
print(f" Redundancy: {(1 - df['audio_bytes_hash'].nunique()/len(df))*100:.2f}%")
|
| 95 |
+
else:
|
| 96 |
+
print("β
No duplicates found!")
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
### Search by Voice
|
| 100 |
+
|
| 101 |
+
```python
|
| 102 |
+
# Find all "ash" voice samples
|
| 103 |
+
ash_samples = df[df['voice'] == 'ash']
|
| 104 |
+
print(f"Ash voice samples: {len(ash_samples)}")
|
| 105 |
+
|
| 106 |
+
# Get file containing first ash sample
|
| 107 |
+
first_ash = ash_samples.iloc[0]
|
| 108 |
+
print(f"File: {first_ash['parquet_file_name']}")
|
| 109 |
+
print(f"Text: {first_ash['text']}")
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
### Search by Text
|
| 113 |
+
|
| 114 |
+
```python
|
| 115 |
+
# Find audio for specific text
|
| 116 |
+
query = "ΫΫ Ψ§ΫΪ© ΩΩ
ΩΩΫ"
|
| 117 |
+
matches = df[df['text'].str.contains(query, na=False)]
|
| 118 |
+
print(f"Found {len(matches)} matches")
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
### Retrieve Original Audio
|
| 122 |
+
|
| 123 |
+
```python
|
| 124 |
+
from datasets import load_dataset as load_original
|
| 125 |
+
import numpy as np
|
| 126 |
+
from scipy.io import wavfile
|
| 127 |
+
import io
|
| 128 |
+
|
| 129 |
+
def get_audio_by_hash(audio_hash, index_df):
|
| 130 |
+
"""Retrieve original audio bytes using the hash"""
|
| 131 |
+
# Find the row with this hash
|
| 132 |
+
row = index_df[index_df['audio_bytes_hash'] == audio_hash].iloc[0]
|
| 133 |
+
|
| 134 |
+
# Download only the specific parquet file containing this audio
|
| 135 |
+
ds = load_original(
|
| 136 |
+
"humair025/Munch",
|
| 137 |
+
data_files=[row['parquet_file_name']],
|
| 138 |
+
split="train"
|
| 139 |
+
)
|
| 140 |
+
|
| 141 |
+
# Find matching row by ID
|
| 142 |
+
for audio_row in ds:
|
| 143 |
+
if audio_row['id'] == row['id']:
|
| 144 |
+
return audio_row['audio_bytes']
|
| 145 |
+
|
| 146 |
+
return None
|
| 147 |
+
|
| 148 |
+
# Example: Get audio for first row
|
| 149 |
+
row = df.iloc[0]
|
| 150 |
+
audio_bytes = get_audio_by_hash(row['audio_bytes_hash'], df)
|
| 151 |
+
|
| 152 |
+
# Convert to WAV and play
|
| 153 |
+
def pcm16_to_wav(pcm_bytes, sample_rate=22050):
|
| 154 |
+
audio_array = np.frombuffer(pcm_bytes, dtype=np.int16)
|
| 155 |
+
wav_io = io.BytesIO()
|
| 156 |
+
wavfile.write(wav_io, sample_rate, audio_array)
|
| 157 |
+
wav_io.seek(0)
|
| 158 |
+
return wav_io
|
| 159 |
+
|
| 160 |
+
wav_io = pcm16_to_wav(audio_bytes)
|
| 161 |
+
# In Jupyter: IPython.display.Audio(wav_io, rate=22050)
|
| 162 |
+
```
|
| 163 |
+
|
| 164 |
+
---
|
| 165 |
+
|
| 166 |
+
## π Dataset Structure
|
| 167 |
+
|
| 168 |
+
### Data Fields
|
| 169 |
+
|
| 170 |
+
| Field | Type | Description |
|
| 171 |
+
|-------|------|-------------|
|
| 172 |
+
| `id` | int | Original paragraph ID from source dataset |
|
| 173 |
+
| `parquet_file_name` | string | Source file in [Munch](https://huggingface.co/datasets/humair025/Munch) dataset |
|
| 174 |
+
| `text` | string | Original Urdu text |
|
| 175 |
+
| `transcript` | string | TTS transcript (may differ from input) |
|
| 176 |
+
| `voice` | string | Voice used (alloy, echo, fable, onyx, nova, shimmer, coral, verse, ballad, ash, sage, amuch, dan) |
|
| 177 |
+
| `audio_bytes_hash` | string | SHA-256 hash of audio_bytes (64 hex chars) |
|
| 178 |
+
| `audio_size_bytes` | int | Size of original audio in bytes |
|
| 179 |
+
| `timestamp` | string | ISO timestamp of generation (nullable) |
|
| 180 |
+
| `error` | string | Error message if generation failed (nullable) |
|
| 181 |
+
|
| 182 |
+
### Example Row
|
| 183 |
+
|
| 184 |
+
```python
|
| 185 |
+
{
|
| 186 |
+
'id': 42,
|
| 187 |
+
'parquet_file_name': 'tts_data_20251203_130314_83ab0706.parquet',
|
| 188 |
+
'text': 'ΫΫ Ψ§ΫΪ© ΩΩ
ΩΩΫ Ω
ΨͺΩ ΫΫΫ',
|
| 189 |
+
'transcript': 'ΫΫ Ψ§ΫΪ© ΩΩ
ΩΩΫ Ω
ΨͺΩ ΫΫΫ',
|
| 190 |
+
'voice': 'ash',
|
| 191 |
+
'audio_bytes_hash': 'a3f7b2c8e9d1f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9',
|
| 192 |
+
'audio_size_bytes': 52340,
|
| 193 |
+
'timestamp': '2024-12-03T13:03:14.123456',
|
| 194 |
+
'error': None
|
| 195 |
+
}
|
| 196 |
+
```
|
| 197 |
+
|
| 198 |
+
---
|
| 199 |
+
|
| 200 |
+
## π― Use Cases
|
| 201 |
+
|
| 202 |
+
### 1. **Dataset Quality Analysis**
|
| 203 |
+
```python
|
| 204 |
+
# Check for duplicates
|
| 205 |
+
unique_ratio = df['audio_bytes_hash'].nunique() / len(df)
|
| 206 |
+
print(f"Unique audio ratio: {unique_ratio*100:.2f}%")
|
| 207 |
+
|
| 208 |
+
# Analyze voice distribution
|
| 209 |
+
voice_dist = df['voice'].value_counts()
|
| 210 |
+
print(voice_dist)
|
| 211 |
+
|
| 212 |
+
# Find failed generations
|
| 213 |
+
failed = df[df['error'].notna()]
|
| 214 |
+
print(f"Failed generations: {len(failed)}")
|
| 215 |
+
```
|
| 216 |
+
|
| 217 |
+
### 2. **Efficient Data Exploration**
|
| 218 |
+
```python
|
| 219 |
+
# Browse dataset without downloading audio
|
| 220 |
+
print(df[['id', 'text', 'voice', 'audio_size_bytes']].head(20))
|
| 221 |
+
|
| 222 |
+
# Filter by criteria
|
| 223 |
+
short_audio = df[df['audio_size_bytes'] < 30000]
|
| 224 |
+
long_text = df[df['text'].str.len() > 200]
|
| 225 |
+
```
|
| 226 |
+
|
| 227 |
+
### 3. **Selective Download**
|
| 228 |
+
```python
|
| 229 |
+
# Download only specific voices
|
| 230 |
+
ash_files = df[df['voice'] == 'ash']['parquet_file_name'].unique()
|
| 231 |
+
ds = load_dataset("humair025/Munch", data_files=list(ash_files))
|
| 232 |
+
|
| 233 |
+
# Download only short audio samples
|
| 234 |
+
small_files = df[df['audio_size_bytes'] < 40000]['parquet_file_name'].unique()
|
| 235 |
+
ds = load_dataset("humair025/Munch", data_files=list(small_files[:10]))
|
| 236 |
+
```
|
| 237 |
+
|
| 238 |
+
### 4. **Deduplication Pipeline**
|
| 239 |
+
```python
|
| 240 |
+
# Create deduplicated subset
|
| 241 |
+
df_unique = df.drop_duplicates(subset=['audio_bytes_hash'], keep='first')
|
| 242 |
+
print(f"Original: {len(df)} rows")
|
| 243 |
+
print(f"Unique: {len(df_unique)} rows")
|
| 244 |
+
print(f"Duplicates removed: {len(df) - len(df_unique)}")
|
| 245 |
+
|
| 246 |
+
# Save unique references
|
| 247 |
+
df_unique.to_parquet('unique_audio_index.parquet')
|
| 248 |
+
```
|
| 249 |
+
|
| 250 |
+
### 5. **Audio Similarity Search**
|
| 251 |
+
```python
|
| 252 |
+
# Find audio with similar hash prefixes (for clustering)
|
| 253 |
+
target_hash = df.iloc[0]['audio_bytes_hash']
|
| 254 |
+
prefix = target_hash[:8]
|
| 255 |
+
|
| 256 |
+
similar = df[df['audio_bytes_hash'].str.startswith(prefix)]
|
| 257 |
+
print(f"Similar audio candidates: {len(similar)}")
|
| 258 |
+
```
|
| 259 |
+
|
| 260 |
+
---
|
| 261 |
+
|
| 262 |
+
## π Dataset Statistics
|
| 263 |
+
|
| 264 |
+
### Size Comparison
|
| 265 |
+
|
| 266 |
+
| Metric | Original Dataset | Hashed Index | Reduction |
|
| 267 |
+
|--------|------------------|--------------|-----------|
|
| 268 |
+
| Total Size | 2.17 TB | ~500 MB | **99%** |
|
| 269 |
+
| Download Time (100 Mbps) | ~X hours | ~12 seconds | **Thousand TimeΓ** |
|
| 270 |
+
| Load Time | Minutes | Seconds | **~100Γ** |
|
| 271 |
+
| Memory Usage | Cannot fit in RAM | Fit | **Thousands XΓ** |
|
| 272 |
+
|
| 273 |
+
### Content Statistics
|
| 274 |
+
|
| 275 |
+
```
|
| 276 |
+
π Dataset Overview:
|
| 277 |
+
Total Records: ~2,500,000
|
| 278 |
+
Unique Audio: [Run analysis to determine]
|
| 279 |
+
Voices: 13 (alloy, echo, fable, onyx, nova, shimmer, coral, verse, ballad, ash, sage, amuch, dan)
|
| 280 |
+
Languages: Urdu (primary), Mixed (some samples)
|
| 281 |
+
Avg Audio Size: ~50-60 KB per sample
|
| 282 |
+
Avg Duration: ~3-5 seconds per sample
|
| 283 |
+
```
|
| 284 |
+
|
| 285 |
+
---
|
| 286 |
+
|
| 287 |
+
## π§ Advanced Usage
|
| 288 |
+
|
| 289 |
+
### Batch Analysis
|
| 290 |
+
|
| 291 |
+
```python
|
| 292 |
+
# Analyze all hash files
|
| 293 |
+
from datasets import load_dataset
|
| 294 |
+
|
| 295 |
+
ds = load_dataset("humair025/hashed_data", split="train")
|
| 296 |
+
df = pd.DataFrame(ds)
|
| 297 |
+
|
| 298 |
+
# Group by voice
|
| 299 |
+
voice_stats = df.groupby('voice').agg({
|
| 300 |
+
'id': 'count',
|
| 301 |
+
'audio_size_bytes': 'mean',
|
| 302 |
+
'audio_bytes_hash': 'nunique'
|
| 303 |
+
}).rename(columns={
|
| 304 |
+
'id': 'total_samples',
|
| 305 |
+
'audio_size_bytes': 'avg_size',
|
| 306 |
+
'audio_bytes_hash': 'unique_audio'
|
| 307 |
+
})
|
| 308 |
+
|
| 309 |
+
print(voice_stats)
|
| 310 |
+
```
|
| 311 |
+
|
| 312 |
+
### Cross-Reference with Original
|
| 313 |
+
|
| 314 |
+
```python
|
| 315 |
+
# Check if a hash exists in original dataset
|
| 316 |
+
def verify_hash_exists(audio_hash, parquet_file):
|
| 317 |
+
"""Verify a hash actually exists in the original dataset"""
|
| 318 |
+
from datasets import load_dataset
|
| 319 |
+
import hashlib
|
| 320 |
+
|
| 321 |
+
ds = load_dataset(
|
| 322 |
+
"humair025/Munch",
|
| 323 |
+
data_files=[parquet_file],
|
| 324 |
+
split="train"
|
| 325 |
+
)
|
| 326 |
+
|
| 327 |
+
for row in ds:
|
| 328 |
+
computed_hash = hashlib.sha256(row['audio_bytes']).hexdigest()
|
| 329 |
+
if computed_hash == audio_hash:
|
| 330 |
+
return True
|
| 331 |
+
|
| 332 |
+
return False
|
| 333 |
+
|
| 334 |
+
# Verify first entry
|
| 335 |
+
first_row = df.iloc[0]
|
| 336 |
+
exists = verify_hash_exists(
|
| 337 |
+
first_row['audio_bytes_hash'],
|
| 338 |
+
first_row['parquet_file_name']
|
| 339 |
+
)
|
| 340 |
+
print(f"Hash verified: {exists}")
|
| 341 |
+
```
|
| 342 |
+
|
| 343 |
+
### Export Unique Dataset
|
| 344 |
+
|
| 345 |
+
```python
|
| 346 |
+
# Create a new dataset with only unique audio
|
| 347 |
+
df_unique = df.drop_duplicates(subset=['audio_bytes_hash'], keep='first')
|
| 348 |
+
|
| 349 |
+
# Get list of unique parquet files needed
|
| 350 |
+
unique_files = df_unique['parquet_file_name'].unique()
|
| 351 |
+
|
| 352 |
+
print(f"Unique audio samples: {len(df_unique)}")
|
| 353 |
+
print(f"Files needed: {len(unique_files)} out of {df['parquet_file_name'].nunique()}")
|
| 354 |
+
|
| 355 |
+
# Calculate space savings
|
| 356 |
+
original_size = len(df) * df['audio_size_bytes'].mean()
|
| 357 |
+
unique_size = len(df_unique) * df_unique['audio_size_bytes'].mean()
|
| 358 |
+
savings = (1 - unique_size/original_size) * 100
|
| 359 |
+
|
| 360 |
+
print(f"Space savings: {savings:.2f}%")
|
| 361 |
+
```
|
| 362 |
+
|
| 363 |
+
---
|
| 364 |
+
|
| 365 |
+
## π οΈ How This Index Was Created
|
| 366 |
+
|
| 367 |
+
This dataset was generated using an automated pipeline:
|
| 368 |
+
|
| 369 |
+
### Processing Pipeline
|
| 370 |
+
1. **Batch Download**: Download 40 parquet files at a time from source
|
| 371 |
+
2. **Hash Computation**: Compute SHA-256 for each audio_bytes field
|
| 372 |
+
3. **Metadata Extraction**: Extract text, voice, and other metadata
|
| 373 |
+
4. **Save & Upload**: Save hash file, upload to HuggingFace
|
| 374 |
+
5. **Clean Up**: Delete local cache to save disk space
|
| 375 |
+
6. **Resume**: Track processed files, skip already-processed
|
| 376 |
+
|
| 377 |
+
### Pipeline Features
|
| 378 |
+
- β
**Resumable**: Checkpoint system tracks progress
|
| 379 |
+
- β
**Memory Efficient**: Processes in batches, clears cache
|
| 380 |
+
- β
**Error Tolerant**: Skips corrupted files, continues processing
|
| 381 |
+
- β
**No Duplicates**: Checks target repo to avoid reprocessing
|
| 382 |
+
- β
**Automatic Upload**: Streams results to HuggingFace
|
| 383 |
+
|
| 384 |
+
### Technical Details
|
| 385 |
+
```python
|
| 386 |
+
# Hash computation
|
| 387 |
+
import hashlib
|
| 388 |
+
hash = hashlib.sha256(audio_bytes).hexdigest()
|
| 389 |
+
|
| 390 |
+
# Batch size: 40 files per batch
|
| 391 |
+
# Processing time: ~4-6 hours for full dataset
|
| 392 |
+
# Output: Multiple hashed_*.parquet files
|
| 393 |
+
```
|
| 394 |
+
|
| 395 |
+
---
|
| 396 |
+
|
| 397 |
+
## π Performance Metrics
|
| 398 |
+
|
| 399 |
+
### Query Performance
|
| 400 |
+
|
| 401 |
+
```python
|
| 402 |
+
import time
|
| 403 |
+
|
| 404 |
+
# Load index
|
| 405 |
+
start = time.time()
|
| 406 |
+
df = pd.read_parquet('hashed_0_39.parquet')
|
| 407 |
+
print(f"Load time: {time.time() - start:.2f}s")
|
| 408 |
+
|
| 409 |
+
# Query by hash
|
| 410 |
+
start = time.time()
|
| 411 |
+
result = df[df['audio_bytes_hash'] == 'target_hash']
|
| 412 |
+
print(f"Hash lookup: {(time.time() - start)*1000:.2f}ms")
|
| 413 |
+
|
| 414 |
+
# Query by voice
|
| 415 |
+
start = time.time()
|
| 416 |
+
result = df[df['voice'] == 'ash']
|
| 417 |
+
print(f"Voice filter: {(time.time() - start)*1000:.2f}ms")
|
| 418 |
+
```
|
| 419 |
+
|
| 420 |
+
**Expected Performance**:
|
| 421 |
+
- Load single file: < 1 second
|
| 422 |
+
- Hash lookup: < 10 milliseconds
|
| 423 |
+
- Voice filter: < 50 milliseconds
|
| 424 |
+
- Full dataset scan: < 5 seconds
|
| 425 |
+
|
| 426 |
+
---
|
| 427 |
+
|
| 428 |
+
## π Integration with Original Dataset
|
| 429 |
+
|
| 430 |
+
### Workflow Example
|
| 431 |
+
|
| 432 |
+
```python
|
| 433 |
+
# 1. Query the index (fast)
|
| 434 |
+
df = pd.read_parquet('hashed_index.parquet')
|
| 435 |
+
target_rows = df[df['voice'] == 'ash'].head(100)
|
| 436 |
+
|
| 437 |
+
# 2. Get unique parquet files
|
| 438 |
+
files_needed = target_rows['parquet_file_name'].unique()
|
| 439 |
+
|
| 440 |
+
# 3. Download only needed files (selective)
|
| 441 |
+
from datasets import load_dataset
|
| 442 |
+
ds = load_dataset(
|
| 443 |
+
"humair025/Munch",
|
| 444 |
+
data_files=list(files_needed),
|
| 445 |
+
split="train"
|
| 446 |
+
)
|
| 447 |
+
|
| 448 |
+
# 4. Match by ID to get audio
|
| 449 |
+
for idx, row in target_rows.iterrows():
|
| 450 |
+
for audio_row in ds:
|
| 451 |
+
if audio_row['id'] == row['id']:
|
| 452 |
+
# Process audio_bytes
|
| 453 |
+
audio = audio_row['audio_bytes']
|
| 454 |
+
break
|
| 455 |
+
```
|
| 456 |
+
|
| 457 |
+
---
|
| 458 |
+
|
| 459 |
+
## π Citation
|
| 460 |
+
|
| 461 |
+
If you use this dataset in your research, please cite both the original dataset and this index:
|
| 462 |
+
|
| 463 |
+
### BibTeX
|
| 464 |
+
|
| 465 |
+
```bibtex
|
| 466 |
+
@dataset{munch_hashed_index_2024,
|
| 467 |
+
title={Munch Hashed Index: Lightweight Reference Dataset for Urdu TTS},
|
| 468 |
+
author={humair025},
|
| 469 |
+
year={2025},
|
| 470 |
+
publisher={Hugging Face},
|
| 471 |
+
howpublished={
|
| 472 |
+
\url{https://huggingface.co/datasets/humair025/hashed_data}
|
| 473 |
+
},
|
| 474 |
+
note={Index of humair025/Munch dataset with SHA-256 audio hashes}
|
| 475 |
+
}
|
| 476 |
+
|
| 477 |
+
@dataset{munch_urdu_tts_2024,
|
| 478 |
+
title={Munch: Large-Scale Urdu Text-to-Speech Dataset},
|
| 479 |
+
author={humair025},
|
| 480 |
+
year={2025},
|
| 481 |
+
publisher={Hugging Face},
|
| 482 |
+
howpublished={
|
| 483 |
+
\url{https://huggingface.co/datasets/humair025/Munch}
|
| 484 |
+
}
|
| 485 |
+
}
|
| 486 |
+
```
|
| 487 |
+
|
| 488 |
+
### APA Format
|
| 489 |
+
|
| 490 |
+
```
|
| 491 |
+
humair025. (2024). Munch Hashed Index: Lightweight Reference Dataset for Urdu TTS
|
| 492 |
+
[Dataset]. Hugging Face. https://huggingface.co/datasets/humair025/hashed_data
|
| 493 |
+
|
| 494 |
+
humair025. (2024). Munch: Large-Scale Urdu Text-to-Speech Dataset [Dataset].
|
| 495 |
+
Hugging Face. https://huggingface.co/datasets/humair025/Munch
|
| 496 |
+
```
|
| 497 |
+
|
| 498 |
+
### MLA Format
|
| 499 |
+
|
| 500 |
+
```
|
| 501 |
+
humair025. "Munch Hashed Index: Lightweight Reference Dataset for Urdu TTS."
|
| 502 |
+
Hugging Face, 2024, https://huggingface.co/datasets/humair025/hashed_data.
|
| 503 |
+
|
| 504 |
+
humair025. "Munch: Large-Scale Urdu Text-to-Speech Dataset." Hugging Face, 2024,
|
| 505 |
+
https://huggingface.co/datasets/humair025/Munch.
|
| 506 |
+
```
|
| 507 |
+
|
| 508 |
+
---
|
| 509 |
+
|
| 510 |
+
## π€ Contributing
|
| 511 |
+
|
| 512 |
+
### Report Issues
|
| 513 |
+
Found a problem? Please open an issue:
|
| 514 |
+
- Missing hash files
|
| 515 |
+
- Incorrect metadata
|
| 516 |
+
- Hash mismatches
|
| 517 |
+
- Documentation improvements
|
| 518 |
+
|
| 519 |
+
### Suggest Improvements
|
| 520 |
+
We welcome suggestions for:
|
| 521 |
+
- Additional metadata fields
|
| 522 |
+
- Better indexing strategies
|
| 523 |
+
- Integration examples
|
| 524 |
+
- Use case documentation
|
| 525 |
+
|
| 526 |
+
---
|
| 527 |
+
|
| 528 |
+
## π License
|
| 529 |
+
|
| 530 |
+
This index dataset inherits the license from the original [Munch dataset](https://huggingface.co/datasets/humair025/Munch):
|
| 531 |
+
|
| 532 |
+
**Creative Commons Attribution 4.0 International (CC-BY-4.0)**
|
| 533 |
+
|
| 534 |
+
You are free to:
|
| 535 |
+
- β
**Share** β copy and redistribute
|
| 536 |
+
- β
**Adapt** β remix, transform, build upon
|
| 537 |
+
- β
**Commercial use** β use commercially
|
| 538 |
+
|
| 539 |
+
Under the terms:
|
| 540 |
+
- π **Attribution** β Give appropriate credit to original dataset
|
| 541 |
+
|
| 542 |
+
---
|
| 543 |
+
|
| 544 |
+
## π Important Links
|
| 545 |
+
|
| 546 |
+
- π§ [**Original Audio Dataset**](https://huggingface.co/datasets/humair025/Munch) - Full 1.+ TB audio
|
| 547 |
+
- π [**This Hashed Index**](https://huggingface.co/datasets/humair025/hashed_data) - Lightweight reference
|
| 548 |
+
- π¬ [**Discussions**](https://huggingface.co/datasets/humair025/hashed_data/discussions) - Ask questions
|
| 549 |
+
- π [**Report Issues**](https://huggingface.co/datasets/humair025/hashed_data/discussions) - Bug reports
|
| 550 |
+
|
| 551 |
+
---
|
| 552 |
+
|
| 553 |
+
## β FAQ
|
| 554 |
+
|
| 555 |
+
### Q: Why use hashes instead of audio?
|
| 556 |
+
**A:** Hashes provide unique fingerprints for audio files while taking only 64 bytes vs ~50kb-12MB per audio. This enables duplicate detection and fast queries without storing massive audio files.
|
| 557 |
+
|
| 558 |
+
### Q: Can I reconstruct audio from hashes?
|
| 559 |
+
**A:** No. SHA-256 is a one-way cryptographic hash. You must download the original audio from the [Munch dataset](https://huggingface.co/datasets/humair025/Munch) using the file reference provided.
|
| 560 |
+
|
| 561 |
+
### Q: How accurate are the hashes?
|
| 562 |
+
**A:** SHA-256 has virtually zero collision probability. If two hashes match, the audio is identical (byte-for-byte).
|
| 563 |
+
|
| 564 |
+
### Q: How do I get the actual audio?
|
| 565 |
+
**A:** Use the `parquet_file_name` and `id` fields to locate and download the specific audio from the [original dataset](https://huggingface.co/datasets/humair025/Munch). See examples above.
|
| 566 |
+
|
| 567 |
+
### Q: Is this dataset complete?
|
| 568 |
+
**A:** This index is continuously updated as new batches are processed. Check the file list to see coverage.
|
| 569 |
+
|
| 570 |
+
### Q: Can I contribute?
|
| 571 |
+
**A:** Yes! Help verify hashes, report inconsistencies, or suggest improvements via discussions.
|
| 572 |
+
|
| 573 |
+
---
|
| 574 |
+
|
| 575 |
+
## π Acknowledgments
|
| 576 |
+
|
| 577 |
+
- **Original Dataset**: [humair025/Munch](https://huggingface.co/datasets/humair025/Munch)
|
| 578 |
+
- **TTS Generation**: OpenAI-compatible models
|
| 579 |
+
- **Voices**: 13 high-quality voices
|
| 580 |
+
- **Infrastructure**: HuggingFace Datasets platform
|
| 581 |
+
- **Hashing**: SHA-256 cryptographic hash function
|
| 582 |
+
|
| 583 |
+
---
|
| 584 |
+
|
| 585 |
+
## π Version History
|
| 586 |
+
|
| 587 |
+
- **v1.0.0** (December 2025): Initial release with hash index
|
| 588 |
+
- Processed [X] out of N parquet files
|
| 589 |
+
- [Y] unique audio hashes identified
|
| 590 |
+
- [Z]% deduplication achieved
|
| 591 |
+
|
| 592 |
+
---
|
| 593 |
+
|
| 594 |
+
**Last Updated**: December 2025
|
| 595 |
+
|
| 596 |
+
**Status**: π Actively Processing (check file count for latest progress)
|
| 597 |
+
|
| 598 |
+
---
|
| 599 |
+
|
| 600 |
+
π‘ **Pro Tip**: Start with this lightweight index to explore the dataset, then selectively download only the audio you need from the [original Munch dataset](https://huggingface.co/datasets/humair025/Munch)!
|