Views
No views yet
SparseEncoder(
(0): MLMTransformer({'max_seq_length': 510, 'do_lower_case': False, 'architecture': 'XLMRobertaForMaskedLM'})
(1): SpladePooling({'pooling_strategy': 'max', 'activation_function': 'relu', 'word_embedding_dimension': 32000})
)pip install -U sentence-transformers1from sentence_transformers import SparseEncoder
2
3# Download from the 🤗 Hub
4model = SparseEncoder("rasyosef/splade-amharic-base")
5# Run inference
6sentences = [
7 'ለውጭ ገበያ በሚቀርበው የኢትዮጵያ ቡና ላይ የተጋረጠው ፈተና',
8 'የኢትዮጵያ ዋነኛ የውጭ ምንዛሬ ምንጭ የሆነው ወደ ውጭ የሚላክ ቡና ዘርፍ በአሁኑ ጊዜ ከፍተኛ ውጥረት ውስጥ ገብቷል። በዚህ የተነሳም የኢትዮጵያ ቡናና ሻይ ባለሥልጣንን ጨምሮ የሚመላካታቸው ሁሉ ቡና ላኪዎችና አምራቾች ያከማቹትን ቡና በፍጥነት ወደ ዓለም ገበያ እንዲያወጡ ጥሪ እያቀረቡ ነው ።',
9 'የቻይናው ፕሬዝዳንት ዚ ጂንፒንግ ከትራምፕ ጋር ባደረጉት ጉባኤ ትኩረታቸው በሁለቱ ሀገራት መካከል ለወራት ከተፈጠረ ውጥረት እና የንግድ ጦርነት በኋላ የተረገጋጋ ግንኙነትን ማስቀጠል ነበር። ከፑቲን ጋር ደግሞ ዢ ለሁለቱ አገራት ስልታዊም ሆነ ኢኮኖሚያዊ ጠቀሜታ ረጅም ጊዜ የዘለቀውን አጋርነትን ይበልጥ ማጠናከር ላይ ነበር ትኩረታቸው።',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 32000]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities)
18# tensor([[45.2024, 19.3316, 0.0000],
19# [19.3316, 48.7685, 8.5323],
20# [ 0.0000, 8.5323, 63.2857]])SparseInformationRetrievalEvaluator| Metric | Value |
|---|---|
| dot_recall@5 | 0.8711 |
| dot_recall@10 | 0.9063 |
| dot_ndcg@10 | 0.7917 |
| dot_mrr@10 | 0.7541 |
| query_active_dims | 69.6236 |
| query_sparsity_ratio | 0.9978 |
| corpus_active_dims | 153.6359 |
| corpus_sparsity_ratio | 0.9952 |
anchor, positive, and negativeSpladeLoss with these parameters:
1{
2 "loss": "SparseMultipleNegativesRankingLoss(scale=1.0, similarity_fct='dot_score')",
3 "document_regularizer_weight": 0.001,
4 "query_regularizer_weight": 0.002
5}eval_strategy: epochper_device_train_batch_size: 32per_device_eval_batch_size: 32gradient_accumulation_steps: 2learning_rate: 6e-05num_train_epochs: 6lr_scheduler_type: cosinewarmup_ratio: 0.025fp16: Trueoptim: adamw_torch_fusedbatch_sampler: no_duplicates1@inproceedings{alemneh2026amharicir,
2 title = {The Multilingual Curse at the Retrieval Layer: Evidence from Amharic},
3 author = {Alemneh, Yosef Worku and Mekonnen, Kidist Amde and de Rijke, Maarten},
4 booktitle = {Proceedings of the 1st Workshop on Multilinguality in the Era of Large Language Models (MeLLM), ACL 2026},
5 year = {2026},
6}