/ Модель

Характеристики

Контекст
8 192 токена
Параметры
149 млн
Лицензия
Apache 2.0
Архитектура
modernbert · dense
Базовая модель
AraModernBert-Base-STS
Библиотека
sentence-transformers
Опубликована
20 авг 2026

islamqa-retriever-quran

ЭмбеддингиТекст → embedding3 профессии

Дообученная арабская ModernBERT-модель создаёт эмбеддинги для поиска и ранжирования отрывков Корана и хадисов по текстовым вопросам.

72скачиваний за 30 дней2лайкавеса обновлены20 авг 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Эмбеддинги» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

islamqa-retriever-quran — арабская bi-encoder-модель для поиска релевантных отрывков Корана и хадисов по текстовому вопросу. Она разработана для проекта IslamicEval 2025 и дообучена на базе NAMAA-Space/AraModernBert-Base-STS; в репозитории находится этап QuQA, выбранный авторами как основной поисковый чекпойнт для Корана. Архитектура — ModernBERT с mean pooling; модель содержит около 149 млн параметров и формирует 768-мерные эмбеддинги, сравниваемые по косинусному сходству. Хотя контекстная архитектура поддерживает до 8192 токенов, эффективный предел последовательности этой версии — 512 токенов.

Модель предназначена для ранжирования существующих фрагментов Корана и хадисов Сахих аль-Бухари по вопросам на современном литературном арабском языке, а также для семантического поиска внутри RAG- и QA-систем. Она специализируется на Коране: на небольших dev-выборках улучшает полноту поиска коранических отрывков относительно базовой модели, но уступает ей на хадисах. Для смешанного потока авторы рекомендуют сочетать её с базовой моделью и калибровать оценки; модель выступает генератором кандидатов, а полный конвейер использует дополнительный reranker. Лицензия — Apache-2.0.

Сценарии применения

  • Поиск коранических аятов по вопросу на арабском языке
  • Ранжирование тематических отрывков Корана для RAG-системы
  • Поиск хадисов Сахих аль-Бухари по арабскому запросу
  • Сравнение семантической близости арабских религиозных текстов

Ограничения

Модель специализирована на Коране и показывает более слабое извлечение хадисов, чем исходная базовая модель; для смешанного поиска рекомендуется отдельный энкодер для хадисов и калибровка оценок. Она предназначена только для поиска существующих текстов, не для генерации религиозных текстов или вынесения религиозных решений; обучающие данные ограничены кораническим QA, тафсиром Джалалайн и хадисами Сахих аль-Бухари.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

islamqa-retriever-quran

An Arabic bi-encoder for Qur'anic passage retrieval, fine-tuned from NAMAA-Space/AraModernBert-Base-STS through a 5-stage curriculum. This repository holds stage 3 (quqa) of that curriculum — the stage selected as the project's production Qur'an retriever.

Built for the IslamicEval 2025 shared task, Subtask 2 (ArabicNLP @ EMNLP 2025): given a free-text question in Modern Standard Arabic, rank passages from the Thematic Qur'anic Passage Collection (1,266 passages) and Sahih Al-Bukhari (2,254 hadiths).

  • Type: sentence-transformers bi-encoder (ModernBertModel + mean pooling)
  • Parameters: ~149M · Embedding dim: 768 · Similarity: cosine
  • Max sequence length: 512 tokens (tokenizer model_max_length; the backbone's max_position_embeddings is 8192, but 512 is the effective limit — index and query must use the same)
  • Pooling: mean · Prompts/prefixes: none (empty for both query and document)
  • Language: Arabic (MSA)

⚠️ Read this before using it: the Qur'an/Hadith seesaw

This checkpoint is Qur'an-specialised, and it paid for that in hadith recall. The curriculum's per-stage evaluation shows a genuine seesaw between the two corpora — training on Qur'anic data (Tafseer, QuQA) lifts Qur'an recall and depresses hadith recall, and the hadith stage reverses it catastrophically.

Dense-only Recall (no BM25, no reranker), measured on the project's two dev splits:

ModelQur'an dev R@10R@30R@70Hadith dev R@10R@30R@70
Base AraModernBert-Base-STS (zero-shot)0.3220.4660.5840.6880.7500.875
stage_1 tydi0.3290.4280.5120.4690.6250.750
stage_2 tafseer0.3470.5650.6760.1880.3440.500
stage_3 quqa — this model0.4330.5620.6830.3130.5310.656
stage_4 haqa0.1050.1340.2290.6880.7810.875
stage_5 task0.3720.4690.6060.2190.3750.625

Qur'an dev = 34 answerable AyaTEC v1.3 dev questions over the 1,266-passage QPC corpus. Hadith dev = 32 questions derived from HaQA over the 2,254-hadith Sahih-Bukhari corpus (a thin, directional split — see caveats below).

Headline: Qur'an dev R@30 0.466 → 0.562 (+20.6% relative) and R@10 0.322 → 0.433 (+34.5%) against the zero-shot base, at the cost of hadith dev R@30 0.750 → 0.531.

So: do not use this model alone on hadith traffic. stage_3 was selected because it dominates every other fine-tuned stage on both splits simultaneously, not because it beats the base model everywhere — it does not.

The recommended production setup is dual: this model + the base model

The parent project runs two encoders, one per corpus, and merges with per-encoder affine calibration constants fitted on shared reference passages:

ConfigurationPooled mixed-traffic MAP@10 (72 questions)
single: base modellower
single: this model (stage_3)0.3646
calibrated dual: this model (Qur'an) + base model (hadith)0.3696

The calibrated dual beats every single-model configuration on the mixed reading that most closely proxies the hidden test set, and it also passes the hadith dev split. Raw concatenation of the two encoders' scores does not work — the base model's cosine scale sits ~0.27 below this model's, so un-calibrated merging silently suppresses the entire hadith corpus.

End-to-end contribution (full pipeline, Qur'an dev)

Within the complete hybrid pipeline (dense + BM25 → Reciprocal Rank Fusion → NAMAA-Space/GATE-Reranker-V1 cross-encoder → answerability threshold gate):

PipelineMAP@10
BM25 only0.086
dense (zero-shot base) only0.169
hybrid + GATE, zero-shot base0.3135
hybrid + GATE, this model0.3303

Over the full 3,520-passage two-corpus store, R@30 rises 0.363 → 0.489. Note that much of the retrieval gain does not reach MAP unless the answerability threshold is re-calibrated for this model's score distribution — a better retriever shifts the distribution the gate sits in.


Usage

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("IdealisticSolutions/islamqa-retriever-quran")

questions = ["ما هو أعظم الذنوب؟"]
passages  = [
    "إن الله لا يغفر أن يشرك به ويغفر ما دون ذلك لمن يشاء ومن يشرك بالله فقد ضل ضلالا بعيدا.",
    "ألهاكم التكاثر. حتى زرتم المقابر. كلا سوف تعلمون. ثم كلا سوف تعلمون.",
]

q = model.encode(questions, normalize_embeddings=True)
p = model.encode(passages,  normalize_embeddings=True)
print(model.similarity(q, p))   # cosine

No prompt prefix or instruction template is needed — unlike e5 (query: / passage:) or Qwen3, this model was trained without prefixes and adding them will hurt.

Text normalisation must match training. Qur'anic passages (Tanzil simple-clean) carry no diacritics; hadith text does. Strip diacritics ([ً-ْٰ]) from hadith before encoding, and use the identical normalisation at index time and at query time. A retriever that normalises differently on the two sides is a silent quality bug, not an error.

Dual-encoder sketch (Qur'an + hadith)

quran_enc  = SentenceTransformer("IdealisticSolutions/islamqa-retriever-quran")
hadith_enc = SentenceTransformer("NAMAA-Space/AraModernBert-Base-STS")
# Retrieve from each corpus with its own encoder, then merge with per-encoder
# affine calibration (NOT raw score concatenation — see the seesaw section).

Training

Curriculum: TyDiQA-ar → Jalalayn Tafseer → QuQA (this checkpoint) → HaQA → task data. Each stage initialises from the previous stage's weights and is evaluated on both dev splits; stage 3 is where the run was cut.

Base modelNAMAA-Space/AraModernBert-Base-STS
Init weights for this stagestage_2 (tafseer), itself from stage_1 (tydi), itself from the base
Stage datasetQuQA — 2,176 questions, 1,269 passages
Training pairs23,436 rows (3,365 positive / 20,071 negative)
Hard negativesmined from top-K retrieval, K = 70; 2,000 questions probed, 9,972 negatives added
LossContrastiveLoss, margin 0.5
Epochs / steps1.0 / 733
Batch size32 (grad accumulation 1)
LR / schedule2e-5, linear, warmup ratio 0.1, weight decay 0.01
Seed42
Final train loss0.0133
Hardware / time1× NVIDIA RTX 5090 Laptop, 145 s for this stage
Frameworkssentence-transformers 6.0.0 · transformers 5.15.1 · torch 2.11.0+cu128
Trained2026-08-19/20

Positive-only training loses roughly 20% recall on this task — the hard negatives are not optional.

Training data sources

  • QuQA — Qur'anic question–answer pairs (this stage)
  • TyDiQA-ar (stage 1), Jalalayn Tafseer (stage 2), HaQA (stage 4), AyaTEC task data (stage 5)
  • Corpora: Thematic Qur'anic Passage Collection v1.1; Sahih Al-Bukhari v1.0

All of these are third-party datasets distributed with the IslamicEval 2025 shared task; their own terms apply to the data, independent of this model's weights.


Evaluation caveats (please read)

  • The official dev split is Qur'an-only. Every team in the 2025 shared task saw its score collapse from dev to the mixed hidden test set. Never select a checkpoint or a threshold on the Qur'an dev split alone — that trap is exactly why stage_5 (which looks fine on dev) is not the shipped checkpoint.
  • The hadith dev split is thin (32 questions) and directional, not precise. It is derived by grounding held-out HaQA questions onto Sahih-Bukhari at a precision-first match threshold; only ~17% ground.
  • The hadith dev split contains no unanswerable questions, so it can validate ranking but can never calibrate a zero-answer gate.
  • Dense-only numbers above are recall over a single corpus; the end-to-end MAP numbers are over the full two-corpus 3,520-passage store. They are not comparable to each other.
  • Sample sizes are small (34 and 32 questions). Treat differences under ~0.02 as noise.

Intended use, and what this model must not be used for

Intended: ranking and retrieving existing, verbatim passages of the Qur'an and of hadith collections in response to Arabic natural-language questions; semantic similarity over Arabic religious text; a retrieval component inside a larger RAG or QA system.

Not intended, and explicitly out of scope:

  • This model must never be used to generate, paraphrase, complete, correct, or "modernise" Qur'anic or hadith text. It is an embedding model with no generation head, and the surrounding system should return stored passage IDs and verbatim stored text only. Hallucinated or misattributed religious content is the primary failure mode this entire project exists to prevent.
  • It is not a source of religious rulings, and retrieval rank is not a statement of authenticity, authority, or theological correctness.
  • It is Arabic-only. Non-Arabic questions must be translated to MSA before encoding; measured end-to-end loss for translated English questions is roughly −13% MAP@10, and about 70% of that loss is translation-induced ranking scatter that no answerability threshold recovers.
  • If any translation is displayed to a user, the Arabic source must be shown verbatim and the translation clearly labelled as approximate — never presented as the source text.

Bias and limitations: trained on one Qur'anic QA dataset and one tafseer (Jalalayn), so it inherits their coverage, phrasing, and interpretive perspective. Hadith coverage is limited to Sahih Al-Bukhari. Recall@10 on Qur'an dev is 0.433 — this model is a candidate generator, and the pipeline that produced the MAP numbers above depends on a cross-encoder reranker downstream.

License and attribution

Licensed Apache-2.0, inherited from the base model NAMAA-Space/AraModernBert-Base-STS (Apache-2.0), which is itself a fine-tune of NAMAA-Space/AraModernBert-Base-V1.0. These weights are a derivative work of that checkpoint; credit for the Arabic ModernBERT backbone and its STS fine-tune belongs to NAMAA-Space. The training datasets are third-party and carry their own terms.

Citation

The shared task and the reference pipeline this work reproduces and extends:

@inproceedings{islamiceval2025,
  title     = {IslamicEval 2025 Shared Task, Subtask 2: Qur'an and Hadith Passage Retrieval},
  booktitle = {Proceedings of ArabicNLP @ EMNLP 2025},
  year      = {2025}
}

Backbone: Warner et al., Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder (ModernBERT), 2024. Training framework: Reimers & Gurevych, Sentence-BERT (arXiv:1908.10084).

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · sentence-transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
ModernBertModel
Ревизия весов
02320f7

0 моделей