Text Ranking
sentence-transformers
Safetensors
Transformers
Arabic
xlm-roberta
text-classification
text-embeddings-inference
Run this model with HF Jobs
Run Omartificial-Intelligence-Space/ARA-Reranker-V1 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Omartificial-Intelligence-Space/ARA-Reranker-V1. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Omartificial-Intelligence-Space/ARA-Reranker-V1 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Omartificial-Intelligence-Space/ARA-Reranker-V1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Omartificial-Intelligence-Space/ARA-Reranker-V1 with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("Omartificial-Intelligence-Space/ARA-Reranker-V1") query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Transformers
How to use Omartificial-Intelligence-Space/ARA-Reranker-V1 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Omartificial-Intelligence-Space/ARA-Reranker-V1") model = AutoModelForSequenceClassification.from_pretrained("Omartificial-Intelligence-Space/ARA-Reranker-V1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
update readme.md
Browse files13 unmodified lines141516171819202122232413 unmodified lines**For more info please refer to this blog: [ARM | Arabic Reranker Model](www.omarai.me).**✨ This model is designed specifically for Arabic language reranking tasks, optimized to handle queries and passages with precision.✨ Unlike embedding models, which generate vector representations, this reranker directly evaluates the similarity between a question and a document, outputting a relevance score.✨ Trained on a combination of positive and hard negative query-passage pairs, it excels in identifying the most relevant results.✨ The output score can be transformed into a [0, 1] range using a sigmoid function, providing a clear and interpretable measure of relevance.13 unmodified lines14151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878813 unmodified lines**For more info please refer to this blog: [ARM | Arabic Reranker Model](www.omarai.me).**✨ This model is designed specifically for Arabic language reranking tasks, optimized to handle queries and passages with precision.✨ Unlike embedding models, which generate vector representations, this reranker directly evaluates the similarity between a question and a document, outputting a relevance score.✨ Trained on a combination of positive and hard negative query-passage pairs, it excels in identifying the most relevant results.✨ The output score can be transformed into a [0, 1] range using a sigmoid function, providing a clear and interpretable measure of relevance.## Usage### Using sentence-transformers```pip installsentence-transformers``````pythonfrom sentence_transformers import CrossEncoder# Load the cross-encoder model# Define a query and a set of candidates with varying degrees of relevancequery = "تطبيقات الذكاء الاصطناعي تُستخدم في مختلف المجالات لتحسين الكفاءة."# Candidates with varying relevance to the querycandidates = ["الذكاء الاصطناعي يساهم في تحسين الإنتاجية في الصناعات المختلفة.", # Highly relevant"نماذج التعلم الآلي يمكنها التعرف على الأنماط في مجموعات البيانات الكبيرة.", # Moderately relevant"الذكاء الاصطناعي يساعد الأطباء في تحليل الصور الطبية بشكل أفضل.", # Somewhat relevant"تستخدم الحيوانات التمويه كوسيلة للهروب من الحيوانات المفترسة.", # Irrelevant]# Create pairs of (query, candidate) for each candidatequery_candidate_pairs = [(query, candidate) for candidate in candidates]# Get relevance scores from the modelscores = model.predict(query_candidate_pairs)# Combine candidates with their scores and sort them by score in descending order (higher score = higher relevance)ranked_candidates = sorted(zip(candidates, scores), key=lambda x: x[1], reverse=True)# Output the ranked candidates with their scoresprint("Ranked candidates based on relevance to the query:")for i, (candidate, score) in enumerate(ranked_candidates, 1):print(f"Rank {i}:")print(f"Candidate: {candidate}")print(f"Score: {score}\n")```## Evaluation## <span style="color:blue">Acknowledgments</span>The author would like to thank Prince Sultan University for their invaluable support in this project. Their contributions and resources have been instrumental in the development and fine-tuning of these models.```markdown## CitationIf you use the GATE, please cite it as follows:@misc{nacar2025ARM,title={ARM, Arabic Reranker Model},author={Omer Nacar},year={2025},url={https://huggingface.co/Omartificial-Intelligence-Space/ARA-Reranker-V1},}
README.md+65-1