dalil-span-ner-onnx (dalil-span-ner-v1)

A 112.81 MB per-channel QInt8 ONNX (plus 224.16 MB FP16 Safetensors) multilingual (id / ar / en) 11-label BIO dalil span extractor trained on top of intfloat/multilingual-e5-small (MIT). Built as a zero-PyTorch neural complement to dalil-guard and DarsNote (processing Whisper transcripts from kajian-id-ar-whisper-lora), with frozen word_embeddings (21.50M trainable transformer + BIO head params) trained in pure FP32 on an NVIDIA GeForce GTX 1060 6GB.

Extracted Entity Labels (BIO-11)

  • QURAN_REF: Quranic verse citations across Indonesian, English, Arabic & canonical URIs (QS. Al-Baqarah: 275, Al Baqarah 275, ุณูˆุฑุฉ ุงู„ุฅุฎู„ุงุต ุขูŠุฉ ูก, quran:2:275)
  • QURAN_QUOTE: Quoted OR unquoted / Whisper-ASR-style unpunctuated Quranic text spans
  • HADITH_REF: Hadith collection citations (HR. Bukhari no. 1, Sahih Muslim 93, ุตุญูŠุญ ู…ุณู„ู… ุฑู‚ู… ูก, hadith:bukhari:1)
  • HADITH_QUOTE: Quoted OR unquoted Hadith matan spans
  • FIQH_REF: Contemporary fatwa, AAOIFI, IIFA, DSN-MUI, PSAK, and Shamela citations (Fatwa DSN-MUI No. 04/DSN-MUI/IV/2000, AAOIFI Shari'ah Standard No. 12, fatwa:dsn_mui:04)

Honest Benchmark Comparison: Deterministic Regex vs FP32 PyTorch vs INT8 ONNX

All 270 rows of ridloabelian/dalil-citation-bench and all 59 rows of ridloabelian/fiqh-muashir are strictly zero-shot held out (0 URI/fatwa-number overlap with train or validation). Held-out test splits also enforce zero Surah, Hadith book, or text overlap.

Benchmark Items Metric Regex Baseline (extract.go) PyTorch FP32 INT8 ONNX (112.81 MB)
Held-Out Formatted (test) 640 Exact Micro F1 0.9187 0.9934 0.9934
Held-Out Unquoted Kajian (test) 600 Exact Micro F1 0.6546 0.9882 0.9890
Hard Negatives (Pasal, HR Dept, tech) 400 False Positive Rate โ†“ 0.1350 0.0000 0.0000
Zero-Shot dalil-citation-bench (Formatted) 270 Exact / Relaxed F1 1.0000 / 1.0000 0.9785 / 0.9826 0.9796 / 0.9816
Zero-Shot dalil-citation-bench (Unquoted) 270 Exact / Relaxed F1 0.7171 / 0.7198 0.9482 / 0.9938 0.9502 / 0.9959
Zero-Shot fiqh-muashir (59 Fatwas) 59 Exact / Relaxed F1 0.8000 / 0.8000 0.9542 / 0.9542 0.9620 / 0.9620

Zero-Shot Per-Entity Breakdown (dalil-citation-bench, Unquoted Delimiters)

When guillemets (ยซยป, ๏ดฟ๏ดพ, ") are absent โ€” as in raw Whisper ASR lecture transcripts โ€” deterministic delimiter regex cannot find any quote span (0.0000), while dalil-span-ner-onnx recovers both references and quotes across all 3 languages:

Entity Type Gold Count Regex Exact F1 INT8 Exact F1 INT8 Relaxed F1
QURAN_REF 164 1.0000 1.0000 1.0000
QURAN_QUOTE 138 0.0000 0.8623 1.0000
HADITH_REF 98 1.0000 1.0000 1.0000
HADITH_QUOTE 72 0.0000 0.9324 0.9730
FIQH_REF 8 1.0000 1.0000 1.0000

Parity & Zero-Leakage Audit

  • PyTorch FP32 vs ONNX FP32 Max Abs Diff: 5.72e-06 (< 1e-4)
  • ONNX FP32 Batch Padding Invariance Max Diff: 0.00e+00 (< 1e-4)
  • Pure SentencePiece vs HF AutoTokenizer Parity: 0/500 mismatches
  • FP32 vs Per-Channel QInt8 ONNX Cosine Similarity: 0.999680 (112.81 MB, ops: int8_qint8_per_channel_gather)
  • Leakage Checks (dataset_audit.json): surah_overlap = 0, hadith_book_overlap = 0, dalil_bench_uri_overlap = 0, fiqh_muashir_overlap = 0, text_overlap = 0.

Zero-PyTorch Quickstart

pip install onnxruntime sentencepiece numpy
python inference_example.py --model onnx/dalil-span-ner-v1-int8.onnx
Downloads last month
-
Safetensors
Model size
0.1B params
Tensor type
F16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for ridloabelian/dalil-span-ner-onnx

Quantized
(338)
this model

Datasets used to train ridloabelian/dalil-span-ner-onnx

Collections including ridloabelian/dalil-span-ner-onnx

Evaluation results

  • Unquoted Kajian Exact Micro F1 (INT8) on Held-out Unquoted Kajian Split + Zero-Shot Unquoted dalil-citation-bench
    self-reported
    0.989
  • Zero-Shot dalil-citation-bench Unquoted Relaxed F1 (INT8) on Held-out Unquoted Kajian Split + Zero-Shot Unquoted dalil-citation-bench
    self-reported
    0.996
  • Zero-Shot dalil-citation-bench Formatted Relaxed F1 (INT8) on Held-out Unquoted Kajian Split + Zero-Shot Unquoted dalil-citation-bench
    self-reported
    0.982
  • Zero-Shot fiqh-muashir Relaxed F1 (INT8) on Held-out Unquoted Kajian Split + Zero-Shot Unquoted dalil-citation-bench
    self-reported
    0.962