ALJIACHI / Mizan-Rerank-V2

huggingface.co
Total runs: 785
24-hour runs: 122
7-day runs: 325
30-day runs: 231
Model's Last Updated: April 28 2026
text-ranking

Introduction of Mizan-Rerank-V2

Model Details of Mizan-Rerank-V2

Mizan-Rerank-v2

A high-performance open-source cross-encoder model for reranking Arabic long texts, fine-tuned from Alibaba-NLP/gte-multilingual-reranker-base with state-of-the-art results on Arabic reranking benchmarks.

Hugging Face Model Size License

Overview

Mizan-Rerank-v2 is a cross-encoder reranking model based on Alibaba-NLP/gte-multilingual-reranker-base , specifically fine-tuned for Arabic text reranking. It excels at reranking long documents (up to 8192 tokens) and outperforms both its base model and larger competitors on Arabic reranking benchmarks.

Key Features
  • Long Document Support : Handles up to 8192 tokens using RoPE position embeddings with NTK scaling
  • Superior Arabic Performance : Outperforms BAAI/bge-reranker-v2-m3 (568M) despite being nearly half the size
  • Arabic Language Optimization : Fine-tuned on 1.2M+ Arabic query-document pairs from diverse sources
Performance Benchmarks

Reranker Benchmark Comparison

Reranking Evaluation (ndcg@10)
Model Parameters Reranking Triplet MIRACL (Long Docs) WikiQA MedQA
Mizan-Rerank-v2 305M 1.0000 0.9993 0.8091 0.8258 0.6775
BAAI/bge-reranker-v2-m3 568M 1.0000 0.9998 0.7231 0.8669 0.6584
Alibaba-NLP/gte-multilingual-reranker-base 305M 1.0000 0.9991 0.7539 0.8275 0.6648
ALJIACHI/Mizan-Rerank-v1 149M 0.9986 0.9955 0.7370 0.7739 0.5502
Key Improvements over Base Model
Benchmark Base Model Mizan-Rerank-v2 Improvement
Reranking 1.0000 1.0000 --
Triplet 0.9991 0.9993 +0.0002
MIRACL (Long Docs) 0.7539 0.8091 +0.0552
WikiQA 0.8275 0.8258 -0.0017
MedQA 0.6648 0.6775 +0.0127
Key Improvements over BAAI/bge-reranker-v2-m3
Benchmark bge-reranker-v2-m3 Mizan-Rerank-v2 Improvement
Reranking 1.0000 1.0000 --
Triplet 0.9998 0.9993 -0.0005
MIRACL (Long Docs) 0.7231 0.8091 +0.0860
WikiQA 0.8669 0.8258 -0.0411
MedQA 0.6584 0.6775 +0.0191
Model Details
  • Model Type: Cross Encoder
  • Base Model: Alibaba-NLP/gte-multilingual-reranker-base
  • Architecture: NewForSequenceClassification (12 layers, 768 hidden, 12 heads)
  • Maximum Sequence Length: 8192 tokens
  • Position Embeddings: RoPE with NTK scaling (factor 8.0)
  • Number of Output Labels: 1
  • Language: Arabic (ar), English (en)
  • License: Apache 2.0
Usage
Using Sentence Transformers
pip install -U sentence-transformers
from sentence_transformers import CrossEncoder

# Load model
model = CrossEncoder("ALJIACHI/Mizan-Rerank-v2", max_length=8192, trust_remote_code=True)

# Score query-document pairs
pairs = [
    ["ما هو تفسير الآية وجعلنا من الماء كل شيء حي",
     "تعني الآية أن الماء هو عنصر أساسي في حياة جميع الكائنات الحية، وهو ضروري لاستمرار الحياة."],
    ["ما هو تفسير الآية وجعلنا من الماء كل شيء حي",
     "تم اكتشاف كواكب خارج المجموعة الشمسية تحتوي على مياه متجمدة."],
    ["ما هو تفسير الآية وجعلنا من الماء كل شيء حي",
     "تحدث القرآن الكريم عن البرق والرعد في عدة مواضع مختلفة."],
]

scores = model.predict(pairs)
print(scores)
# High score for the relevant passage, low scores for irrelevant ones

# Or rank documents for a query
ranks = model.rank(
    "ما هو تفسير الآية وجعلنا من الماء كل شيء حي",
    [
        "تعني الآية أن الماء هو عنصر أساسي في حياة جميع الكائنات الحية، وهو ضروري لاستمرار الحياة.",
        "تم اكتشاف كواكب خارج المجموعة الشمسية تحتوي على مياه متجمدة.",
        "تحدث القرآن الكريم عن البرق والرعد في عدة مواضع مختلفة.",
    ]
)
print(ranks)
# [{'corpus_id': 0, 'score': ...}, {'corpus_id': 1, 'score': ...}, ...]
Using Transformers Directly
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch

model = AutoModelForSequenceClassification.from_pretrained(
    "ALJIACHI/Mizan-Rerank-v2",
    trust_remote_code=True,
    torch_dtype=torch.float16,
)
tokenizer = AutoTokenizer.from_pretrained("ALJIACHI/Mizan-Rerank-v2")

def get_relevance_score(query, passage):
    inputs = tokenizer(query, passage, return_tensors="pt", padding=True, truncation=True, max_length=8192)
    with torch.no_grad():
        outputs = model(**inputs)
    return torch.sigmoid(outputs.logits).item()

query = "ما هي فوائد فيتامين د؟"
passages = [
    "يساعد فيتامين د في تعزيز صحة العظام وتقوية الجهاز المناعي، كما يلعب دوراً مهماً في امتصاص الكالسيوم.",
    "يستخدم فيتامين د في بعض الصناعات الغذائية كمادة حافظة.",
    "أطلقت وزارة الزراعة حملة وطنية لزيادة الوعي بأهمية الزراعة العضوية.",
]

scores = [(p, get_relevance_score(query, p)) for p in passages]
reranked = sorted(scores, key=lambda x: x[1], reverse=True)

for passage, score in reranked:
    print(f"Score: {score:.4f} | {passage[:80]}...")
Training Details
Training Data

Trained on 1,199,634 query-document pairs from diverse Arabic sources

Training Configuration
Parameter Value
Base Model Alibaba-NLP/gte-multilingual-reranker-base
Max Sequence Length 8192
Batch Size 2
Gradient Accumulation Steps 16
Effective Batch Size 32
Learning Rate 5e-7
LR Scheduler Cosine
Warmup Ratio 0.1
Precision FP16
Gradient Checkpointing Enabled
Loss Function BinaryCrossEntropyLoss (pos_weight=1.24)
Applications
  • Arabic search engines and information retrieval systems
  • RAG (Retrieval-Augmented Generation) pipelines
  • Islamic text search and jurisprudence Q&A
  • Digital library and archive search
  • Long-document Arabic content analysis
  • E-learning platforms with Arabic content
Framework Versions
  • Python: 3.10.14
  • Sentence Transformers: 5.4.1
  • Transformers: 4.55.4
  • PyTorch: 2.8.0+cu126
  • Accelerate: 1.10.0
  • Datasets: 3.5.0
  • Tokenizers: 0.21.0
Citation
@software{Mizan_Rerank_v2_2026,
  author = {Ali Aljiachi},
  title = {Mizan-Rerank-v2: Arabic Long-Context Text Reranking Model},
  year = {2026},
  publisher = {Hugging Face},
  url = {https://huggingface.co/ALJIACHI/Mizan-Rerank-v2}
}
@inproceedings{reimers-2019-sentence-bert,
    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month = "11",
    year = "2019",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/1908.10084",
}
License

Released under the Apache 2.0 License .

Runs of ALJIACHI Mizan-Rerank-V2 on huggingface.co

785
Total runs
122
24-hour runs
135
3-day runs
325
7-day runs
231
30-day runs

More Information About Mizan-Rerank-V2 huggingface.co Model

More Mizan-Rerank-V2 license Visit here:

https://choosealicense.com/licenses/apache-2.0

Mizan-Rerank-V2 huggingface.co

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

Mizan-Rerank-V2 huggingface.co Url

https://huggingface.co/ALJIACHI/Mizan-Rerank-V2

ALJIACHI Mizan-Rerank-V2 online free

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

ALJIACHI Mizan-Rerank-V2 online free url in huggingface.co:

https://huggingface.co/ALJIACHI/Mizan-Rerank-V2

Mizan-Rerank-V2 install

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

Mizan-Rerank-V2 install url in huggingface.co:

https://huggingface.co/ALJIACHI/Mizan-Rerank-V2

Url of Mizan-Rerank-V2

Mizan-Rerank-V2 huggingface.co Url

Provider of Mizan-Rerank-V2 huggingface.co

ALJIACHI
ORGANIZATIONS

Other API from ALJIACHI

huggingface.co

Total runs: 231
Run Growth: -1.3K
Growth Rate: -546.32%
Updated:May 05 2025