Fiqh-Rerank AR/FA

Fiqh-Rerank is a bilingual cross-encoder for re-ranking passages of Islamic jurisprudence in the Ja'fari (Imami) tradition. Given an Arabic or Persian question and a candidate passage, it returns a relevance score; applied to the top results of a first-stage retriever, it moves the passage that actually settles the question to the top.

It is the second stage of the same pipeline as Fiqh-Embed: retrieve with Fiqh-Embed, re-rank with Fiqh-Rerank. Built by Sadiqoon Technologies on BAAI/bge-reranker-v2-m3 (568M parameters), with the same interface — a drop-in replacement.

نموذج إعادة ترتيب ثنائيّ اللغة لمقاطع الفقه الإماميّ. يأخذ السؤال والمقطع معًا ويُخرج درجة صلة، فيرفع النصّ الذي يحسم المسألة إلى صدارة نتائج الاسترجاع. مبنيّ على bge-reranker-v2-m3 ويحلّ محلّه مباشرة.

Highlights

  • Question-aware ranking. Scores the question and passage jointly, so colloquial or loosely phrased questions still land on the exact ruling.
  • Arabic ⇄ Persian. Re-ranks Persian passages for Arabic questions and vice versa.
  • Pairs with Fiqh-Embed. Retrieve 20–40 candidates with Fiqh-Embed, then re-rank; the two models were tuned on the same material.
  • Drop-in for bge-reranker-v2-m3. Same tokenizer, same scoring head, same code.

Evaluation

Held-out set of 292 real questions across six categories, judged against pooled relevance labels (TREC-style). Each model re-ranks the top-40 candidates of a dense retriever; nDCG@10 of the resulting top-10:

Category n Dense only bge-reranker-v2-m3 Fiqh-Rerank
All 292 0.446 0.443 0.468
Colloquial / dialectal questions 25 0.378 0.333 0.414
Conceptual & applied questions 110 0.450 0.460 0.486
Prohibition / negation rulings 60 0.469 0.524 0.515
Terminology & definitions 45 0.483 0.440 0.456
Arabic question → Persian passage 45 0.419 0.359 0.411
Precise citation lookup 7 0.374 0.425 0.401

The stock reranker is a net loss over the dense retriever on this material; Fiqh-Rerank turns it into a gain, most clearly on colloquial questions and on cross-lingual pairs.

Training

  • Corpus: 40,183 passages from the reference works in Arabic and Persian — Ajwibat al-Istiftāʾāt, Taḥrīr al-Wasīla, al-Risāla al-Taʿlīmiyya, Risāla fī al-Ṣalāt wa-l-Ṣawm, al-Aḥkām al-Muntakhaba, Tawḍīḥ al-Masāʾil and others.
  • Pairs: ~3,300 real user questions matched to their source passages by verbatim quotation and page reference, plus ~8,800 Arabic queries written for Persian passages.
  • Objective: listwise cross-entropy over one positive and mined hard negatives per question, Arabic and Persian mixed in every batch.

Usage

sentence-transformers

from sentence_transformers import CrossEncoder
model = CrossEncoder("sadiqoon/fiqh-rerank-ar-fa", max_length=512)

question = "هل يجب الخمس في الذهب الملبوس؟"
passages = [
    "لا يجب الخمس في ما لا يدخل في مسمّى التكسّب حتى لو مضى عليه سنة أو أكثر.",
    "طلا و جواهراتی که زن برای زینت استفاده می‌کند، در صورتی که متناسب با شأن او باشد، خمس ندارد.",
    "يستحب للمصلّي أن يأتي بالأذان والإقامة قبل الصلاة.",
]
scores = model.predict([(question, p) for p in passages])
for p, s in sorted(zip(passages, scores), key=lambda x: -x[1]):
    print(f"{s:6.2f}  {p}")

Transformers

import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tok = AutoTokenizer.from_pretrained("sadiqoon/fiqh-rerank-ar-fa")
model = AutoModelForSequenceClassification.from_pretrained("sadiqoon/fiqh-rerank-ar-fa").eval()

pairs = [(question, p) for p in passages]
with torch.no_grad():
    t = tok(pairs, padding=True, truncation=True, max_length=512, return_tensors="pt")
    scores = model(**t).logits.squeeze(-1)

With Fiqh-Embed

from sentence_transformers import SentenceTransformer, CrossEncoder
embed = SentenceTransformer("sadiqoon/fiqh-embed-ar-fa")
rerank = CrossEncoder("sadiqoon/fiqh-rerank-ar-fa")

q = embed.encode(question, normalize_embeddings=True)
cands = index.search(q, top_k=40)                       # your vector store
scores = rerank.predict([(question, c.text) for c in cands])
top = [c for _, c in sorted(zip(scores, cands), key=lambda x: -x[0])][:5]

Citation

@misc{sadiqoon2026fiqhrerank,
  title  = {Fiqh-Rerank AR/FA: A Bilingual Cross-Encoder for Imami Jurisprudence},
  author = {Sadiqoon Technologies},
  year   = {2026},
  url    = {https://huggingface.co/sadiqoon/fiqh-rerank-ar-fa}
}

License & Contact

MIT. Built and maintained by Sadiqoon Technologies Ltd, London. Questions and collaboration: info@sadiqoon.uk

Downloads last month
-
Safetensors
Model size
0.6B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for sadiqoon/fiqh-rerank-ar-fa

Finetuned
(101)
this model