CoolFace
Modelpublic

mogesa/Roberta-amharic-news-sentence-transformer

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes18downloads
Model Card

SentenceTransformer based on rasyosef/roberta-amharic-text-embedding-medium

This is a sentence-transformers model finetuned from rasyosef/roberta-amharic-text-embedding-medium. It maps sentences & paragraphs to a 512-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.

Model Details

Model Description

  • —Model Type: Sentence Transformer
  • —Base model: rasyosef/roberta-amharic-text-embedding-medium <!-- at revision 89d2a0b5aa3e92afb8c7e6658c0ff304cc0e9242 -->
  • —Maximum Sequence Length: 510 tokens
  • —Output Dimensionality: 512 dimensions
  • —Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 510, 'do_lower_case': False}) with Transformer model: XLMRobertaModel 
  (1): Pooling({'word_embedding_dimension': 512, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
  (2): Normalize()
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("mogesa/Roberta-amharic-news-sentence-transformer")
# Run inference
sentences = [
    'የግሉ ወረት እና አፍሪቃ',
    '« በፊናንሱ ተቋማዊ ተሀድሶ የተነሳ የአፍሪቃ ህብረት ለቀጣዩ በጀቱ 12 ከመቶ ቁጠባ አድርጓል በዚህ አባል ሀገራት ያበረከቱት አስተዋፅኦ ትልቅ ነው',
    'በሱዳን ጉዳይ ጣልቃ በመግባት የነዳጅ የሌሎች የተፈጥሮ ሀብቷን የመቀራመት እድል ሊፈጠር ሰበብ የሚሰጡ ሀገራት መኖራቸው ደግሞ ሁለተኛው ምክንያት ነው',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 512]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

Unnamed Dataset
  • —Size: 217,850 training samples
  • —Columns: <code>sentence0</code>, <code>sentence1</code>, and <code>label</code>
  • —Approximate statistics based on the first 1000 samples: | | sentence0 | sentence1 | label | |:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:-----------------------------------------------------------------| | type | string | string | float | | details | <ul><li>min: 6 tokens</li><li>mean: 11.96 tokens</li><li>max: 35 tokens</li></ul> | <ul><li>min: 8 tokens</li><li>mean: 21.1 tokens</li><li>max: 57 tokens</li></ul> | <ul><li>min: -0.17</li><li>mean: 0.37</li><li>max: 0.9</li></ul> |
  • —Samples: | sentence0 | sentence1 | label | |:----------------------------------------------------------|:-------------------------------------------------------------------------------------------------|:------------------------| | <code>በማእከላዊ ጎንደር ዞን ጠገዴ የታገቱት ስድስት ታዳጊዎች ለምን ተገደሉ</code> | <code>"ቦታው ዘወር ያለ ነበር ኮከራ ቀበሌ የሚባል ድሮም 'የሽፍታ መጠጊያ' ይባላል</code> | <code>0.33186144</code> | | <code>የኢትዮ-ምህዳር ጋዜጣ ዋና አዘጋጅ ታሰረ</code> | <code>ዋና አዘጋጁ በወንጀል ህግ በአንቀፅ 613 “ስማ ማጥፋት የሀሰት ሀሜት” በሚል የተቀመጠውን ተላልፏል በሚል የተከሰሰው</code> | <code>0.50249875</code> | | <code>አምባሳደር ሺን ፤ ኢትዮጵያና ኤርትራ</code> | <code>አምባሳደሩ ቀደም በአለም አቀፍ ፍርድ ቤት በተደረገ ድርድር ውጤት ባድመ የኤርትራ መሆኗን እትዮጵያውያን መቀበል ይኖርባቸዋል ብለዋል</code> | <code>0.54789203</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —per_device_train_batch_size: 16
  • —per_device_eval_batch_size: 16
  • —multi_dataset_batch_sampler: round_robin
All Hyperparameters

<details><summary>Click to expand</summary>

  • —overwrite_output_dir: False
  • —do_predict: False
  • —eval_strategy: no
  • —prediction_loss_only: True
  • —per_device_train_batch_size: 16
  • —per_device_eval_batch_size: 16
  • —per_gpu_train_batch_size: None
  • —per_gpu_eval_batch_size: None
  • —gradient_accumulation_steps: 1
  • —eval_accumulation_steps: None
  • —torch_empty_cache_steps: None
  • —learning_rate: 5e-05
  • —weight_decay: 0.0
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —max_grad_norm: 1
  • —num_train_epochs: 3
  • —max_steps: -1
  • —lr_scheduler_type: linear
  • —lr_scheduler_kwargs: {}
  • —warmup_ratio: 0.0
  • —warmup_steps: 0
  • —log_level: passive
  • —log_level_replica: warning
  • —log_on_each_node: True
  • —logging_nan_inf_filter: True
  • —save_safetensors: True
  • —save_on_each_node: False
  • —save_only_model: False
  • —restore_callback_states_from_checkpoint: False
  • —no_cuda: False
  • —use_cpu: False
  • —use_mps_device: False
  • —seed: 42
  • —data_seed: None
  • —jit_mode_eval: False
  • —use_ipex: False
  • —bf16: False
  • —fp16: False
  • —fp16_opt_level: O1
  • —half_precision_backend: auto
  • —bf16_full_eval: False
  • —fp16_full_eval: False
  • —tf32: None
  • —local_rank: 0
  • —ddp_backend: None
  • —tpu_num_cores: None
  • —tpu_metrics_debug: False
  • —debug: []
  • —dataloader_drop_last: False
  • —dataloader_num_workers: 0
  • —dataloader_prefetch_factor: None
  • —past_index: -1
  • —disable_tqdm: False
  • —remove_unused_columns: True
  • —label_names: None
  • —load_best_model_at_end: False
  • —ignore_data_skip: False
  • —fsdp: []
  • —fsdp_min_num_params: 0
  • —fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • —fsdp_transformer_layer_cls_to_wrap: None
  • —accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • —deepspeed: None
  • —label_smoothing_factor: 0.0
  • —optim: adamw_torch
  • —optim_args: None
  • —adafactor: False
  • —group_by_length: False
  • —length_column_name: length
  • —ddp_find_unused_parameters: None
  • —ddp_bucket_cap_mb: None
  • —ddp_broadcast_buffers: False
  • —dataloader_pin_memory: True
  • —dataloader_persistent_workers: False
  • —skip_memory_metrics: True
  • —use_legacy_prediction_loop: False
  • —push_to_hub: False
  • —resume_from_checkpoint: None
  • —hub_model_id: None
  • —hub_strategy: every_save
  • —hub_private_repo: None
  • —hub_always_push: False
  • —gradient_checkpointing: False
  • —gradient_checkpointing_kwargs: None
  • —include_inputs_for_metrics: False
  • —include_for_metrics: []
  • —eval_do_concat_batches: True
  • —fp16_backend: auto
  • —push_to_hub_model_id: None
  • —push_to_hub_organization: None
  • —mp_parameters:
  • —auto_find_batch_size: False
  • —full_determinism: False
  • —torchdynamo: None
  • —ray_scope: last
  • —ddp_timeout: 1800
  • —torch_compile: False
  • —torch_compile_backend: None
  • —torch_compile_mode: None
  • —dispatch_batches: None
  • —split_batches: None
  • —include_tokens_per_second: False
  • —include_num_input_tokens_seen: False
  • —neftune_noise_alpha: None
  • —optim_target_modules: None
  • —batch_eval_metrics: False
  • —eval_on_start: False
  • —use_liger_kernel: False
  • —eval_use_gather_object: False
  • —average_tokens_across_devices: False
  • —prompts: None
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: round_robin

</details>

Training Logs

EpochStepTraining Loss
0.03675001.2372
0.073410001.0754
0.110215001.0128
0.146920000.9841
0.183625000.944
0.220330000.9168
0.257135000.8863
0.293840000.8685
0.330545000.8575
0.367250000.8637
0.403955000.8353
0.440760000.8147
0.477465000.7913
0.514170000.7751
0.550875000.7719
0.587580000.7605
0.624385000.7206
0.661090000.7219
0.697795000.7302
0.7344100000.7307
0.7712105000.7019
0.8079110000.7127
0.8446115000.6693
0.8813120000.6934
0.9180125000.6721
0.9548130000.6657
0.9915135000.6696
1.0282140000.5583
1.0649145000.5335
1.1016150000.5234
1.1384155000.5192
1.1751160000.5317
1.2118165000.5325
1.2485170000.5201
1.2853175000.5096
1.3220180000.5001
1.3587185000.5015
1.3954190000.4862
1.4321195000.4901
1.4689200000.5168
1.5056205000.499
1.5423210000.4937
1.5790215000.4772
1.6157220000.4709
1.6525225000.4971
1.6892230000.485
1.7259235000.4689
1.7626240000.4789
1.7994245000.4606
1.8361250000.4711
1.8728255000.4774
1.9095260000.4649
1.9462265000.4779
1.9830270000.4703
2.0197275000.4202
2.0564280000.389
2.0931285000.3824
2.1298290000.3682
2.1666295000.3764
2.2033300000.366
2.2400305000.3723
2.2767310000.38
2.3135315000.3632
2.3502320000.3817
2.3869325000.3894
2.4236330000.3844
2.4603335000.3761
2.4971340000.3871
2.5338345000.3672
2.5705350000.3621
2.6072355000.3907
2.6439360000.3688
2.6807365000.3653
2.7174370000.3632
2.7541375000.3698
2.7908380000.3696
2.8276385000.3624
2.8643390000.3731
2.9010395000.3634
2.9377400000.3504
2.9744405000.3643

Framework Versions

  • —Python: 3.11.11
  • —Sentence Transformers: 4.1.0
  • —Transformers: 4.48.3
  • —PyTorch: 2.5.1+cu124
  • —Accelerate: 1.3.0
  • —Datasets: 3.5.0
  • —Tokenizers: 0.21.0

Citation

BibTeX

Sentence Transformers
bibtex
@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",
}
MultipleNegativesRankingLoss
bibtex
@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply},
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->