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