rasyosef/Amharic-Passage-Retrieval-Dataset-V2
Viewer • Updated • 68.3k • 70
How to use rasyosef/reranker-amharic-medium with sentence-transformers:
from sentence_transformers import CrossEncoder
model = CrossEncoder("rasyosef/reranker-amharic-medium")
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)This is a Cross Encoder model finetuned from rasyosef/roberta-medium-amharic using the sentence-transformers library. It computes scores for pairs of texts, which can be used for text reranking and semantic search.
This model is part of the research presented in the paper "The Multilingual Curse at the Retrieval Layer: Evidence from Amharic".
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import CrossEncoder
# Download from the 🤗 Hub
model = CrossEncoder("rasyosef/reranker-amharic-medium")
# Get scores for pairs of texts
pairs = [
['ለውጭ ገበያ በሚቀርበው የኢትዮጵያ ቡና ላይ የተጋረጠው ፈተና', 'የኢትዮጵያ ዋነኛ የውጭ ምንዛሬ ምንጭ የሆነው ወደ ውጭ የሚላክ ቡና ዘርፍ በአሁኑ ጊዜ ከፍተኛ ውጥረት ውስጥ ገብቷል።'],
['ለውጭ ገበያ በሚቀርበው የኢትዮጵያ ቡና ላይ የተጋረጠው ፈተና', 'የቻይናው ፕሬዝዳንት ዚ ጂንፒንግ ከትራምፕ ጋር ባደረጉት ጉባኤ ትኩረታቸው በሁለቱ ሀገራት መካከል ለወራት ከተፈጠረ ውጥረት እና የንግድ ጦርነት በኋላ የተረገጋጋ ግንኙነትን ማስቀጠል ነበር።']
]
scores = model.predict(pairs)
print(scores.shape)
# (2,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'ለውጭ ገበያ በሚቀርበው የኢትዮጵያ ቡና ላይ የተጋረጠው ፈተና',
[
'የኢትዮጵያ ዋነኛ የውጭ ምንዛሬ ምንጭ የሆነው ወደ ውጭ የሚላክ ቡና ዘርፍ በአሁኑ ጊዜ ከፍተኛ ውጥረት ውስጥ ገብቷል።',
'የቻይናው ፕሬዝዳንት ዚ ጂንፒንግ ከትራምፕ ጋር ባደረጉት ጉባኤ ትኩረታቸው በሁለቱ ሀገራት መካከል ለወራት ከተፈጠረ ውጥረት እና የንግድ ጦርነት በኋላ የተረገጋጋ ግንኙነትን ማስቀጠል ነበር።',
]
)
print(ranks)
# [{'corpus_id': 0, 'score': ...}, {'corpus_id': 1, 'score': ...}]
amh-passage-retrieval-devCrossEncoderRerankingEvaluator with these parameters:{
"at_k": 10
}
| Metric | Value |
|---|---|
| mrr@10 | 0.805 |
| ndcg@10 | 0.835 |
query, passage, and labelBinaryCrossEntropyLoss with these parameters:{
"activation_fn": "torch.nn.modules.linear.Identity",
"pos_weight": 7
}
eval_strategy: epochper_device_train_batch_size: 64per_device_eval_batch_size: 64learning_rate: 4e-05num_train_epochs: 4lr_scheduler_type: cosinewarmup_ratio: 0.05fp16: Truedataloader_num_workers: 2load_best_model_at_end: Truebatch_sampler: no_duplicates| Epoch | Step | Training Loss | amh-passage-retrieval-dev_ndcg@10 |
|---|---|---|---|
| 1.0 | 7684 | 0.4048 | 0.8289 |
| 2.0 | 15368 | 0.2366 | 0.8546 |
| 3.0 | 23052 | 0.1588 | 0.8353 |
| 4.0 | 30736 | 0.1024 | 0.8551 |
@inproceedings{alemneh2026amharicir,
title = {The Multilingual Curse at the Retrieval Layer: Evidence from Amharic},
author = {Alemneh, Yosef Worku and Mekonnen, Kidist Amde and de Rijke, Maarten},
booktitle = {Proceedings of the 1st Workshop on Multilinguality in the Era of Large Language Models (MeLLM), ACL 2026},
year = {2026},
}
Base model
rasyosef/roberta-medium-amharic