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 files20 unmodified lines2122232425262728293031323334303536373828 unmodified lines6768697071727374757677787980818283848586878889909192939495969720 unmodified lines
✨ The output score can be transformed into a [0, 1] range using a sigmoid function, providing a clear and interpretable measure of relevance.
## Arabic RAG Pipeline

## Usage ### Using sentence-transformers
```pip installsentence-transformerspip install sentence-transformers``````pythonfrom sentence_transformers import CrossEncoder28 unmodified lines print(f"Score: {score}\n")```## Evaluation ### Dataset
Size: 3000 samples.
### Structure:🔸 Query: A string representing the user's question.
🔸 Candidate Document: A candidate passage to answer the query.
🔸 Relevance Label: Binary label (1 for relevant, 0 for irrelevant).
### Evaluation Process
🔸 Query Grouping: Queries are grouped to evaluate the model's ability to rank candidate documents correctly for each query.
🔸 Model Prediction: Each model predicts relevance scores for all candidate documents corresponding to a query.
🔸 Metrics Calculation: Metrics are computed to measure how well the model ranks relevant documents higher than irrelevant ones.
| Model | MRR | MAP | nDCG@10 ||-------------------------------------------|------------------|------------------|------------------|| cross-encoder/ms-marco-MiniLM-L-6-v2 | 0.6313333333333334 | 0.6313333333333334 | 0.725444959171438 || cross-encoder/ms-marco-MiniLM-L-12-v2 | 0.6643333333333332 | 0.6643333333333332 | 0.7500407855785803 || BAAI/bge-reranker-v2-m3 | 0.9023333333333332 | 0.9023333333333332 | 0.9274971489500038 || Omartificial-Intelligence-Space/ARA-Reranker-V1 | 0.9335 | 0.9335 | 0.9507001860964314 |
README.md+30-1