CoolFace
Modelpublic

AbdouMagico/cross-scriptural-verse-matcher

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
Model Card

Cross-Scriptural Verse Matcher

A unified framework for finding theologically relevant verses across the Old Testament (OT), New Testament (NT), and the Quran based on semantic meaning and latent thematic guidance.

Architecture

  • Base Encoder: intfloat/multilingual-e5-base — multilingual sentence embeddings, strong zero-shot retrieval
  • Latent Guidance Head: Multi-label thematic classifier (45 theological themes) on top of embeddings
  • Scripture-Type Embedding: Learned embedding for OT/NT/Quran to condition the shared space
  • Loss: Combined contrastive (InfoNCE with hard negatives) + thematic BCE classification

Training Recipe

ComponentValue
Base modelintfloat/multilingual-e5-base
Fine-tuningLoRA (r=16, alpha=32) on Q,K,V,Dense
Max length256
Batch size32
Learning rate3e-4
Temperature0.05
Theme loss weight (λ)0.3
Epochs5
OptimizerAdamW with cosine schedule
Precisionbf16

Dataset

Cross-scriptural verse pairs generated via LLM annotation with:

  • Similarity scores (0.0–1.0)
  • Relationship types: thematic, narrative, prophetic, lexical, ethical, cosmological
  • Hard negatives: same-theme verses with different meaning
  • 45 theological themes for latent guidance

Source datasets:

  • Quran: freococo/quran_multilingual_parallel (English)
  • Bible: davidguzmanr/open-bible-resources (English Standard, verse-level)

Usage

Training

bash
python train.py

Inference

bash
python inference.py --query "For God so loved the world" --top_k 5

Repositories

  • Model: https://huggingface.co/AbdouMagico/cross-scriptural-verse-matcher
  • Dataset: https://huggingface.co/datasets/AbdouMagico/cross-scriptural-pairs

Citation

Built on:

  • SimCSE (Gao et al., 2021) — contrastive sentence embeddings
  • E5 (Wang et al., 2022) — weakly-supervised text embedding
  • multilingual-e5 (XLM-R backbone) — cross-lingual alignment