sadiqoon / fiqh-classifier-ar

huggingface.co
Total runs: 6
24-hour runs: 0
7-day runs: 0
30-day runs: -7
Model's Last Updated: September 02 2026
text-classification

Introduction of fiqh-classifier-ar

Model Details of fiqh-classifier-ar

Fiqh-Classifier AR

Fiqh-Classifier reads a question as people actually write it — formal, dialectal, or mid-conversation — and tells you two things at once: which chapter of jurisprudence it belongs to, and whether it is too vague to answer without a follow-up. It is the routing layer in front of a fiqh assistant: pick the right index, the right prompt, the right specialist, before any retrieval happens.

Built by Sadiqoon Technologies on intfloat/multilingual-e5-base (278M parameters) with two lightweight heads over mean-pooled embeddings. A single forward pass, ~10 ms on GPU.

مصنّف يقرأ السؤال الفقهيّ كما يكتبه الناس — فصيحًا كان أو دارجًا أو مبتورًا — فيحدّد بابه من ثمانية عشر بابًا، وهل يحتاج إلى استيضاح قبل الجواب. طبقة توجيه تسبق الاسترجاع.

Labels

Chapter (18): طهارة · صلاة · صوم · خمس · زكاة · حج وعمرة · معاملات ومال · نكاح وأسرة · طلاق · نظر وحجاب ولباس · أطعمة وأشربة · نذر ويمين وكفارات · وقف ووصية وإرث · حدود وقصاص وديات · عقائد وأخلاق · جهاد وسياسة وحكومة · طب وحياة معاصرة · متفرقات

Needs clarification: boolean — the question is a fragment, a bare greeting, or lacks the detail a jurist would ask for.

Evaluation

900 held-out questions, labelled by chapter and clarification need:

Output Metric Score
Chapter (18-way) accuracy 0.743
Chapter (18-way) macro-F1 0.661
Needs clarification F1 (positive class, 1.2% prevalence) 0.267

The chapter head is the workhorse; the clarification head is a conservative signal best combined with your own length or context heuristics.

Training

~8,900 real questions in Arabic — formal and dialectal — each labelled with its chapter. Multi-task fine-tuning of the full encoder with class-balanced cross-entropy for the chapter head, four epochs.

Usage
# pip install transformers huggingface_hub torch
from huggingface_hub import hf_hub_download
import importlib.util
spec = importlib.util.spec_from_file_location("fc", hf_hub_download("sadiqoon/fiqh-classifier-ar", "fiqh_classifier.py"))
fc = importlib.util.module_from_spec(spec); spec.loader.exec_module(fc)

clf = fc.FiqhClassifier()
clf("هل يجب الخمس في الذهب الملبوس؟")
# {'topic': 'خمس', 'topic_confidence': 0.99, 'needs_clarification': False}

clf(["شو حكم الصلاة بالجراب اذا في ثقب صغير", "اجرت بيتي لواحد وما دفع الايجار شهرين شو بعمل", "السلام عليكم"])
# [{'topic': 'صلاة', 'topic_confidence': 0.88, 'needs_clarification': False},
#  {'topic': 'معاملات ومال', 'topic_confidence': 0.92, 'needs_clarification': False},
#  {'topic': 'متفرقات', 'topic_confidence': 0.80, 'needs_clarification': True}]

The repository ships the encoder in the standard Transformers layout plus heads.pt / heads_config.json ; fiqh_classifier.py is a 30-line wrapper you can copy into your own code.

Citation
@misc{sadiqoon2026fiqhclassifier,
  title  = {Fiqh-Classifier AR: Chapter and Clarity Routing for Jurisprudential Questions},
  author = {Sadiqoon Technologies},
  year   = {2026},
  url    = {https://huggingface.co/sadiqoon/fiqh-classifier-ar}
}
License & Contact

MIT. Built and maintained by Sadiqoon Technologies Ltd , London. Questions and collaboration: [email protected]

Runs of sadiqoon fiqh-classifier-ar on huggingface.co

6
Total runs
0
24-hour runs
1
3-day runs
0
7-day runs
-7
30-day runs

More Information About fiqh-classifier-ar huggingface.co Model

More fiqh-classifier-ar license Visit here:

https://choosealicense.com/licenses/mit

fiqh-classifier-ar huggingface.co

fiqh-classifier-ar huggingface.co is an AI model on huggingface.co that provides fiqh-classifier-ar's model effect (), which can be used instantly with this sadiqoon fiqh-classifier-ar model. huggingface.co supports a free trial of the fiqh-classifier-ar model, and also provides paid use of the fiqh-classifier-ar. Support call fiqh-classifier-ar model through api, including Node.js, Python, http.

fiqh-classifier-ar huggingface.co Url

https://huggingface.co/sadiqoon/fiqh-classifier-ar

sadiqoon fiqh-classifier-ar online free

fiqh-classifier-ar huggingface.co is an online trial and call api platform, which integrates fiqh-classifier-ar's modeling effects, including api services, and provides a free online trial of fiqh-classifier-ar, you can try fiqh-classifier-ar online for free by clicking the link below.

sadiqoon fiqh-classifier-ar online free url in huggingface.co:

https://huggingface.co/sadiqoon/fiqh-classifier-ar

fiqh-classifier-ar install

fiqh-classifier-ar is an open source model from GitHub that offers a free installation service, and any user can find fiqh-classifier-ar on GitHub to install. At the same time, huggingface.co provides the effect of fiqh-classifier-ar install, users can directly use fiqh-classifier-ar installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

fiqh-classifier-ar install url in huggingface.co:

https://huggingface.co/sadiqoon/fiqh-classifier-ar

Url of fiqh-classifier-ar

fiqh-classifier-ar huggingface.co Url

Provider of fiqh-classifier-ar huggingface.co

sadiqoon
ORGANIZATIONS

Other API from sadiqoon

huggingface.co

Total runs: 103
Run Growth: -346
Growth Rate: -335.92%
Updated:September 02 2026