Downloads · 30 days
2
4% of all-time downloads
dotquran/quran-5gram
quran-5gram is a machine learning model from dotquran. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
A 5-gram statistical language model trained on the Quran corpus (6,348 verses), built with KenLM.
Downloads · 30 days
2
4% of all-time downloads
All-time downloads
48
Public
Repo size
—
Likes
1
Public
Click a slice to open those files.
.arpa16.5 MB · 70%
From the Hugging Face model README
A 5-gram statistical language model trained on the Quran corpus (6,348 verses), built with KenLM.
quran-simple-clean.txt — 6,348 Quranic verses, one per line.| File | Format | Description |
|---|---|---|
quran_5gram.arpa | ARPA text | Portable n-gram model |
quran_5gram.binary | KenLM binary | Fast probing hash |
config.json | JSON | Model metadata |
import kenlm
model = kenlm.Model("quran_5gram.binary") # or .arpa
# Score a verse (log10 probability)
score = model.score("بسم الله الرحمن الرحيم")
# Perplexity
ppl = model.perplexity("الحمد لله رب العالمين")
# Score a verse sequence (consecutive recitation)
sequence = "بسم الله الرحمن الرحيم الحمد لله رب العالمين"
seq_score = model.score(sequence)
Install KenLM Python bindings: pip install kenlm