hetchyy's picture
Update version to v0.3.10
d2cf9f3 verified
metadata
license: apache-2.0
task_categories:
  - automatic-speech-recognition
language:
  - ar
tags:
  - quran
  - recitation
  - forced-alignment
  - word-timestamps
  - letter-timestamps
  - audio-segmentation
  - speech-recognition
  - asr
  - vad
  - phoneme
version: v0.3.10
pretty_name: Qur'anic Universal Ayahs
size_categories:
  - 1K<n<10K
configs:
  - config_name: hafs_an_asim
    data_files:
      - split: mohammed_siddiq_al_minshawi
        path: hafs_an_asim/mohammed_siddiq_al_minshawi-*
  - config_name: reciters
    data_files:
      - split: all
        path: reciters/all-*
dataset_info:
  - config_name: hafs_an_asim
    features:
      - name: audio
        dtype: audio
      - name: surah
        dtype: int32
      - name: ayah
        dtype: int32
      - name: duration_ms
        dtype: int32
      - name: text_uthmani
        dtype: string
      - name: segments
        sequence:
          sequence: int32
      - name: word_timestamps
        sequence:
          sequence: int32
      - name: letter_timestamps
        sequence:
          - name: word_idx
            dtype: int32
          - name: char
            dtype: string
          - name: start_ms
            dtype: int32
          - name: end_ms
            dtype: int32
      - name: source_url
        dtype: string
      - name: source_offset_ms
        dtype: int32
    splits:
      - name: mohammed_siddiq_al_minshawi
        num_bytes: 0
        num_examples: 6236
    download_size: 1569809077
    dataset_size: 1571705367
  - config_name: reciters
    features:
      - name: reciter
        dtype: string
      - name: name_en
        dtype: string
      - name: name_ar
        dtype: string
      - name: riwayah
        dtype: string
      - name: style
        dtype: string
      - name: country
        dtype: string
      - name: source
        dtype: string
      - name: audio_category
        dtype: string
      - name: url_template
        dtype: string
      - name: coverage_surahs
        dtype: int32
      - name: coverage_ayahs
        dtype: int32
      - name: is_timestamped
        dtype: bool
    splits:
      - name: all
        num_bytes: 69253
        num_examples: 338
    download_size: 26962
    dataset_size: 69253

Demo - Qur'anic Universal Aligner Request - Align a Reciter
Audio Only Riwayat Timestamped
Latest Release GitHub stars License

Qur'anic Universal Ayahs

Word-level and letter-level aligned Qur'an recitation audio with precise timestamps derived from phoneme-level forced alignment.
A community-verified dataset of 300+ reciters across 14 riwayat.

Dataset Description

Each row is one verse (ayah) of the Qur'an, with:

  • Audio clip of the verse recitation, trimmed to speech boundaries
  • Word-level timestamps in milliseconds, relative to the audio clip. The word_idx refers to the canonical word position in the verse, not the position in the text_uthmani field. When the reciter repeats a word, the same word_idx may appear multiple times and indices may go backward.
  • Letter-level timestamps for individual Arabic characters, tokenized as follows.
  • Pause-based segments showing how the recitation was naturally divided by silences
  • Uthmani text from alignment matching (reflects what was actually recited, including any repetitions). Non-recited markers (waqf signs, hizb, sajdah) are stripped.

Usage

from datasets import load_dataset

# Load a specific reciter (subset = riwayah, split = reciter)
ds = load_dataset("hetchyy/quranic-universal-ayahs", "hafs_an_asim", split="minshawy_murattal")

# Access a verse
verse = ds[0]
print(verse["surah"], verse["ayah"])       # 1 1
print(verse["duration_ms"])                 # Duration in ms
print(verse["text_uthmani"])                # Uthmani Arabic text
print(verse["word_timestamps"])             # [[1, 0, 400], [2, 400, 800], ...]

# Letter-level timestamps (if available)
lt = verse["letter_timestamps"]
if lt["word_idx"]:
    for w, ch, s, e in zip(lt["word_idx"], lt["char"], lt["start_ms"], lt["end_ms"]):
        print(f"  Word {w}: {ch} [{s}-{e}]ms")

# Play audio (in a notebook)
from IPython.display import Audio
Audio(verse["audio"]["array"], rate=verse["audio"]["sampling_rate"])

Schema

Column Type Description
audio Audio Verse audio (MP3), trimmed to speech boundaries
surah int32 Surah number (1-114)
ayah int32 Verse number within surah
duration_ms int32 Audio clip duration in milliseconds
text_uthmani string Uthmani Arabic text of the verse from alignment
segments [[int, int, int, int]] Pause-based segments (ms, relative to clip)
word_timestamps [[int, int, int]] Word-level timestamps (ms, relative to clip)
letter_timestamps [[int, str, int, int]] Per-letter timestamps: [word_idx, char, start_ms, end_ms]. Empty if not available.
source_url string Original audio file URL (chapter or verse)
source_offset_ms int32 Offset in source audio where this verse starts (ms)

Column Details

segments — Each segment is [word_from, word_to, start_ms, end_ms]. A continuous speech region between pauses.

Segments capture the natural pausing points in a recitation. A gap between consecutive segments is a pause. The word ranges tell you whether the reciter continued from where they left off or went back and repeated:

  • Sequential word ranges (next word_from = previous word_to + 1) — the reciter paused and continued.
  • Overlapping word ranges (next word_from ≤ previous word_to) — the reciter paused and repeated those words before continuing. The text_uthmani field includes the repeated words.

word_timestamps — Each entry is [word_index, start_ms, end_ms]. When a verse contains repeated segments, the same word index appears multiple times.

letter_timestamps — Per-letter character timestamps from phoneme-level forced alignment. Each entry is [word_idx, char, start_ms, end_ms] where word_idx matches the word_timestamps word index and char is the Arabic character. Multiple entries share the same word_idx for multi-letter words. Empty for reciters without letter-level alignment data.

duration_ms — Duration of the audio clip in milliseconds. Equal to the span from first word start to last word end.

text_uthmani — Uthmani script Arabic text from alignment. Non-recited markers (waqf stop signs, hizb markers, sajdah marks) are stripped. Preserves diacritics, silent markers, and tajweed annotations. Reflects what was actually recited, including any repetitions.

source_url — URL of the original audio file. For by-surah reciters, all verses in a surah share one URL; for by-ayah reciters, each verse has its own.

source_offset_ms — Millisecond offset in source_url where this verse begins. Convert clip-relative timestamps to source-relative: source_ms = clip_ms + source_offset_ms.

Example: Segments & Repetitions

Verse 21:73

# Words Time (ms) Text
1 1–8 0–15,030 وَجَعَلْنَـٰهُمْ أَئِمَّةً يَهْدُونَ بِأَمْرِنَا وَأَوْحَيْنَآ إِلَيْهِمْ فِعْلَ ٱلْخَيْرَٰتِ
pause (repeat back)
2 5–12 16,310–30,125 وَأَوْحَيْنَآ إِلَيْهِمْ فِعْلَ ٱلْخَيْرَٰتِ وَإِقَامَ ٱلصَّلَوٰةِ وَإِيتَآءَ ٱلزَّكَوٰةِ
pause (continue)
3 13–15 30,345–34,725 وَكَانُوا۟ لَنَا عَـٰبِدِينَ

The text field contains 19 words (the 4 repeated words appear twice), and word_timestamps has entries for words 5–8 twice.

Gapless Playback

For by-surah reciters, combine source_url + source_offset_ms to seek within the original chapter audio:

fatiha = ds.filter(lambda x: x["surah"] == 1)
chapter_url = fatiha[0]["source_url"]  # all verses share the same chapter URL
for verse in fatiha:
    offset = verse["source_offset_ms"]
    for word_idx, start, end in verse["word_timestamps"]:
        source_start = start + offset  # seek position in chapter audio

Notes

  • All timestamps are in milliseconds, relative to the start of the audio clip
  • Word indices are 1-based
  • Word timestamps are padded forward within each segment so there are no gaps between consecutive words. Gaps only occur across segment boundaries (pauses in recitation).
  • For gapless chapter playback, use source_url directly (don't concatenate clips). Compute source-relative timestamps with source_ms = clip_ms + source_offset_ms. Content not covered by timestamps (e.g. basmalas, cross-verse transitions) plays naturally in the original audio without word highlighting.

Reciters Catalog

The reciters config is a lightweight index of all available reciters. Use it to discover reciters, filter by riwayah/style, and construct audio URLs:

from datasets import load_dataset

reciters = load_dataset("hetchyy/quranic-universal-ayahs", "reciters", split="all")

# All Hafs murattal reciters with full coverage
hafs = reciters.filter(lambda r: r["riwayah"] == "hafs_an_asim" and r["coverage_surahs"] == 114)

# Construct a direct audio URL (add https:// prefix to url_template)
r = hafs[0]
url = "https://" + r["url_template"].format(surah=2)  # Al-Baqarah chapter audio
Column Type Description
reciter string Reciter slug
name_en string English display name
name_ar string Arabic name
riwayah string Riwayah slug (e.g. hafs_an_asim)
style string Recitation style (murattal, mujawwad, muallim)
country string Country of origin
source string Audio source (e.g. mp3quran, everyayah)
audio_category string by_surah or by_ayah
url_template string URL pattern (without https://)
coverage_surahs int32 Number of surahs with audio (max 114)
coverage_ayahs int32 Number of ayahs with audio (max 6,236)
is_timestamped bool Whether word-level timestamps are available in the dataset

Configs

Subset (config) is the riwayah, split is the reciter.

hafs_an_asim

Reciter Style Verses Audio Source
Mohammed Siddiq Al-Minshawi murattal 6,237 mp3quran.net

Pipeline

Audio is processed through a multi-stage pipeline:

  1. VAD segmentation — Detect speech regions using a recitation-specific VAD model
  2. Phoneme-level ASR — CTC-based recognition with wav2vec2
  3. Dynamic programming alignment — Match recognized phonemes against known Qur'anic reference text
  4. MFA forced alignment — Montreal Forced Aligner produces phoneme-level timestamps, from which word boundaries are derived

License

Apache 2.0