hadith_segmentation / README.md
SHK4K's picture
Replace template README with model-linked card
df07aee verified
|
Raw History Blame Contribute Delete
1.77 kB

A newer version of the Gradio SDK is available: 6.32.0

Upgrade
metadata
title: Hadith Segmentation
emoji: ๐Ÿ’ฌ
colorFrom: yellow
colorTo: purple
sdk: gradio
sdk_version: 6.31.0
app_file: app.py
pinned: false
license: mit
short_description: Split a raw hadith into sanad and matn
models:
  - SHK4K/hadith-segmentation-bert
language:
  - ar
tags:
  - hadith
  - sanad
  - matn
  - arabic
  - token-classification
  - digital-humanities

ูุงุตู„ ุงู„ุญุฏูŠุซ โ€” Hadith Splitter

ูŠู‚ุณู… ู†ุต ุญุฏูŠุซ ุฎุงู… (ุจุฏูˆู† ุนู„ุงู…ุงุช ุชุฑู‚ูŠู… ู‡ูŠูƒู„ูŠุฉ) ุฅู„ู‰ ุณู†ุฏ (ุณู„ุณู„ุฉ ุงู„ุฑูˆุงุฉ) ูˆู…ุชู† (ู‚ูˆู„ ุงู„ู†ุจูŠ ุตู„ู‰ ุงู„ู„ู‡ ุนู„ูŠู‡ ูˆุณู„ู…)ุŒ ูˆูŠุนุฑุถ ุงู„ุญุฏูˆุฏ ุจูŠู†ู‡ู…ุง ุจุงู„ุฃู„ูˆุงู† ุนู„ู‰ ุงู„ู†ุต ุงู„ุฃุตู„ูŠ.

Splits a raw hadith string into its sanad (chain of narrators) and matn (the saying itself), and highlights the boundary on the original text.

  • Model: SHK4K/hadith-segmentation-bert (AraBERT v02 fine-tuned for token classification)
  • Labels: B-SANAD, I-SANAD, B-MATN, I-MATN, reduced to a single cut
  • Diacritics are stripped for inference (the model was trained undiacritized) and mapped back, so the output keeps your original vocalized text
  • Long hadiths: processed in overlapping 512-token windows (stride 128) with per-word majority voting, so nothing is truncated
  • Output strings are sliced from your original text, so punctuation and spacing are preserved

Limits

  • Accuracy is limited on unusual orthography; the model was trained on normalized Arabic, and the app normalizes before inference.
  • Pastes longer than ~25k subword tokens are processed only up to that point.
  • The model is small (0.1B); treat the boundary as a suggestion on low-resource texts, not ground truth.