metadata
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:131044
- loss:MatryoshkaLoss
- loss:MultipleNegativesRankingLoss
base_model: Omartificial-Intelligence-Space/Arabic-Triplet-Matryoshka-V2
widget:
- source_sentence: >-
ู
ุงูู ุงูููู
ู ุงูุชู ุชุนูู: ุนู
ูู ูุชู
ุชุฏุงูููุง ุจูู ู
ุฌู
ูุนู ู
ู ุงูุฏูู ุงูู
ุชุญุงููู
ุงูุชุตุงุฏูุง ุจุฏูุง ู
ู ุนู
ูุงุชูุง ุงูู
ุญููู.
sentences:
- 'ุฑุฌุญุงูุ ูุชุฑุฌู
ุชูุง: appropriateุ ููุณู
ูุง ุงูููุงู
ู: ุงุณู
ู
ุนูู'
- ู
ุญูุง
- ุงูุนู
ูู ุงูู
ูุญุฏู
- source_sentence: 'ู
ุงูู ุงูููู
ู ุงูุชู ุชุนูู: ุชุทุงุจู ุงูููุธูู ุงู ุชุดุงุจููู
ุง ูู ุงูู
ุนูู.'
sentences:
- 'ุชุฑุงุฏูุ ูุชุฑุฌู
ุชูุง: synonymityุ ููุณู
ูุง ุงูููุงู
ู: ุงุณู
ู
ุนูู'
- ุชุงุจู
- 'ุดุญุฐุ ูุชุฑุฌู
ุชูุง: To whetุ ููุณู
ูุง ุงูููุงู
ู: ูุนู ู
ุชุนุฏู'
- source_sentence: 'ู
ุงูู ุงูููู
ู ุงูุชู ุชุนูู: ู
ุตุทูุญ ุนูู ุฑู
ุฒ ุงูุทุฑุญ ูู ุงูุญุณุงุจ.'
sentences:
- 'ูุงูุตุ ููุณู
ูุง ุงูููุงู
ู: ุงุณู
ุฐุงุช'
- ู
ูุบูุจ ูู
- 'ุงุณุชุนุงุฑูุ ูุชุฑุฌู
ุชูุง: borrowingุ ููุณู
ูุง ุงูููุงู
ู: ุงุณู
ู
ุนูู'
- source_sentence: 'ู
ุงูู ุงูููู
ู ุงูุชู ุชุนูู: ุชูุซููุ ูุงุญูุงู
.'
sentences:
- ุชูุงุญู
- >-
ู
ุชููุ ูู
ุซุงู ุงูููู
ู ูู: ู
ูุฐ ุงูุจุฏุงูู ุงููู ุจุงูู (ู
ุชูู) ู
ุนู ูู ู
ุนุธู
ู
ุง
ูุงูู.ุ ูุชุฑุฌู
ุชูุง: Agreeing withุ ููุณู
ูุง ุงูููุงู
ู: ุตูู ูุงุนู
- ุชูููุฏ
- source_sentence: >-
ู
ุงูู ุงูููู
ู ุงูุชู ุชุนูู: ุชุญุฒู
ุจุงูุซูุจ ูุดุฏู ุชููุคุง ูุงู
ุฑ ูุงุณุชุนุฏุงุฏุง ููุ ุงู ุฌุฐุจ
ุดุฎุต ู
ู ุซูุงุจู ุงูุชู ุนูุฏ ุนููู
sentences:
- ุชุญุดูู
- ุงูุฐุฑ
- ุชูุจุจ
pipeline_tag: sentence-similarity
library_name: sentence-transformers
SentenceTransformer based on Omartificial-Intelligence-Space/Arabic-Triplet-Matryoshka-V2
This is a sentence-transformers model finetuned from Omartificial-Intelligence-Space/Arabic-Triplet-Matryoshka-V2. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for retrieval.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: Omartificial-Intelligence-Space/Arabic-Triplet-Matryoshka-V2
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
- Supported Modality: Text
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'BertModel'})
(1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'mean', 'include_prompt': True})
)
Usage
Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the ๐ค Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
'ู
ุงูู ุงูููู
ู ุงูุชู ุชุนูู: ุชุญุฒู
ุจุงูุซูุจ ูุดุฏู ุชููุคุง ูุงู
ุฑ ูุงุณุชุนุฏุงุฏุง ููุ ุงู ุฌุฐุจ ุดุฎุต ู
ู ุซูุงุจู ุงูุชู ุนูุฏ ุนููู',
'ุชูุจุจ',
'ุชุญุดูู',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[ 1.0000, 0.4581, 0.1173],
# [ 0.4581, 1.0000, -0.0107],
# [ 0.1173, -0.0107, 1.0000]])
Training Details
Training Dataset
Unnamed Dataset
- Size: 131,044 training samples
- Columns:
anchor,positive, andnegative - Approximate statistics based on the first 1000 samples:
anchor positive negative type string string string details - min: 9 tokens
- mean: 17.41 tokens
- max: 54 tokens
- min: 3 tokens
- mean: 15.64 tokens
- max: 73 tokens
- min: 3 tokens
- mean: 3.97 tokens
- max: 9 tokens
- Samples:
anchor positive negative ู ุงูู ุงูููู ู ุงูุชู ุชุนูู: ูุชุฑ ููุงู ูู ู ููุงู: ุงุถุนููุง.ูุชุฑูุชูู ุงูู ุงูููู ู ุงูุชู ุชุนูู: ุนุงุตู ู ุงูุฑููุฏุงุ ุชูุน ูุฑุจ ู ูุชุตู ุงูุณุงุญู ุงูุดุฑูู ุงูุงูุฑููุฏูุ ุนูุฏ ู ุตุจ ููุฑ ููููุ ูุชูุฏุฑ ู ุณุงุญุชูุง ุจูุญู 117.8 ูููู ู ุชุฑ ู ุฑุจุนุง.ุฏุจููุ ูุชุฑุฌู ุชูุง: Dublinุ ููุณู ูุง ุงูููุงู ู: ุงุณู ุฐุงุชูุงุดูุทูู ุงูู ุงูููู ู ุงูุชู ุชุนูู: ุงููุธุงู ุงูุฐู ูููู ููู ุงูุงูุชุฑุงู ุงูุฐู ูุฎุชูู ุนู ุงูุชุฑุงู ุงูู ุนุงุฏูู ุงูุงุตูู ูุง ูุณุงูู ุตูุฑุง ุณูุงุก ุงูุงูุช ุงูู ุนุงุฏูู ู ู ุงูุฑุชุจู ุงูุงููู ุงู ุงูุซุงููู.ู ุนุงุฏูู ุบูุฑ ู ุชุฌุงูุณูุณูุงุณู ุงูุงุณุชุฎุฏุงู ุงูุนุงุฏู - Loss:
MatryoshkaLosswith these parameters:{ "loss": "MultipleNegativesRankingLoss", "matryoshka_dims": [ 768 ], "matryoshka_weights": [ 1 ], "n_dims_per_step": -1 }
Evaluation Dataset
Unnamed Dataset
- Size: 14,561 evaluation samples
- Columns:
anchor,positive, andnegative - Approximate statistics based on the first 1000 samples:
anchor positive negative type string string string details - min: 9 tokens
- mean: 17.36 tokens
- max: 52 tokens
- min: 3 tokens
- mean: 15.68 tokens
- max: 313 tokens
- min: 3 tokens
- mean: 3.97 tokens
- max: 9 tokens
- Samples:
anchor positive negative ู ุงูู ุงูููู ู ุงูุชู ุชุนูู: ู ุคูุซ (ุฑุฎู)ุฑุฎููุ ููุณู ูุง ุงูููุงู ู: ุตูู ู ุดุจููุฑุฎูููู ุงูู ุงูููู ู ุงูุชู ุชุนูู: ู ุฒุฎุฑู ูู ุฑุตุนู ุจุฑูุดู ุฎุงูู ุงูู ุงูููู ู ุงูุชู ุชุนูู: ู ูุชุณุจ ุญุฑุงู ูุบูุฑ ู ุดุฑูุน ู ู ู ุงู ููุญููู ุณุญุชุ ูู ุซุงู ุงูููู ู ูู: ูุงูู ูุถู ุฑ ูู ุงูู ุณุญุช ูุงูู ุฌูู ู ุง ูุฑูุนู ู ุซู ุงูุฐู ููุญููุุ ููุณู ูุง ุงูููุงู ู: ุตูู ู ูุนููู ุณุญูุช - Loss:
MatryoshkaLosswith these parameters:{ "loss": "MultipleNegativesRankingLoss", "matryoshka_dims": [ 768 ], "matryoshka_weights": [ 1 ], "n_dims_per_step": -1 }
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 512per_device_eval_batch_size: 512num_train_epochs: 5warmup_steps: 0.1fp16: Truebatch_sampler: no_duplicates
All Hyperparameters
Click to expand
do_predict: Falseprediction_loss_only: Trueper_device_train_batch_size: 512per_device_eval_batch_size: 512gradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 5max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_ratio: Nonewarmup_steps: 0.1log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Trueenable_jit_checkpoint: Falsesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseuse_cpu: Falseseed: 42data_seed: Nonebf16: Falsefp16: Truebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: -1ddp_backend: Nonedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonedisable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Falseignore_data_skip: Falsefsdp: []fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Nonegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Truepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_for_metrics: []eval_do_concat_batches: Trueauto_find_batch_size: Falsefull_determinism: Falseddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_num_input_tokens_seen: noneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Trueuse_cache: Falseprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}
Training Logs
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.3906 | 100 | 4.8407 | 2.1680 |
| 0.7812 | 200 | 3.2924 | 1.7895 |
| 1.1719 | 300 | 2.7619 | 1.6139 |
| 1.5625 | 400 | 2.4898 | 1.5162 |
| 1.9531 | 500 | 2.3912 | 1.4297 |
| 2.3438 | 600 | 2.0123 | 1.3458 |
| 2.7344 | 700 | 1.9851 | 1.3046 |
| 3.125 | 800 | 1.8550 | 1.2478 |
| 3.5156 | 900 | 1.7236 | 1.2185 |
| 3.9062 | 1000 | 1.7033 | 1.1993 |
| 4.2969 | 1100 | 1.5782 | 1.1799 |
| 4.6875 | 1200 | 1.5676 | 1.1659 |
Training Time
- Training: 13.5 minutes
Framework Versions
- Python: 3.12.13
- Sentence Transformers: 5.4.1
- Transformers: 5.0.0
- PyTorch: 2.10.0+cu128
- Accelerate: 1.13.0
- Datasets: 4.0.0
- Tokenizers: 0.22.2
Citation
BibTeX
Sentence Transformers
@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",
}
MatryoshkaLoss
@misc{kusupati2024matryoshka,
title={Matryoshka Representation Learning},
author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
year={2024},
eprint={2205.13147},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
MultipleNegativesRankingLoss
@misc{oord2019representationlearningcontrastivepredictive,
title={Representation Learning with Contrastive Predictive Coding},
author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
year={2019},
eprint={1807.03748},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1807.03748},
}