metadata
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:90678
- loss:MatryoshkaLoss
- loss:MultipleNegativesRankingLoss
base_model: Omartificial-Intelligence-Space/Arabic-Triplet-Matryoshka-V2
widget:
- source_sentence: 'ู
ุงูู ุงูููู
ู ุงูุชู ุชุนูู: ุญุฒู ุงูุดุฎุต ูุฌุฑุช ุฏู
ุนุชู.'
sentences:
- ุงุณุชุฐูุงุก
- ู
ุณุชุนุจุฑ
- ุชุดุฎูุตู
- source_sentence: 'ู
ุงูู ุงูููู
ู ุงูุชู ุชุนูู: ุงูู
ุฑู ู
ู ุชูุงูู ุทุนุงู
ูุณูุฑุ ูุชูุฏุฆู ุงูุฌูุน ู
ุคูุชุง.'
sentences:
- ุตุงุญู
- ุงุฏุนุฌ
- ุชุณููุชู
- source_sentence: 'ู
ุงูู ุงูููู
ู ุงูุชู ุชุนูู: ุงุนุชูุงุฏ ุงูุชูุดู ูุดุธู ุงูุนูุด.'
sentences:
- ุงุฎุดูุดุงู
- ูุฒูู
- ุงุณุชุฐูุงู
- source_sentence: 'ู
ุงูู ุงูููู
ู ุงูุชู ุชุนูู: ุชุนุจ ู
ุฑูู ู
ููู ุงูููู.'
sentences:
- ุชููุงู
- ููุฒู
- ุนุงู
ู
- 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.4617, 0.1454],
# [0.4617, 1.0000, 0.0522],
# [0.1454, 0.0522, 1.0000]])
Training Details
Training Dataset
Unnamed Dataset
- Size: 90,678 training samples
- Columns:
anchorandpositive - Approximate statistics based on the first 100 samples:
anchor positive type string string modality text text details - min: 10 tokens
- mean: 14.58 tokens
- max: 27 tokens
- min: 3 tokens
- mean: 3.75 tokens
- max: 5 tokens
- Samples:
anchor positive ู ุงูู ุงูููู ู ุงูุชู ุชุนูู: ูููุง ููุดูุก.ุชุจุนุง ููู ุงูู ุงูููู ู ุงูุชู ุชุนูู: ู ุฑูุจ ูููู ุงููุงุณ ุงู ุงูุจุถุงุฆุน ูู ุงูุจุญุฑ ุงู ุงูููุฑ ุงู ุงููุถุงุก ุงูุฎุงุฑุฌู .ุณูููู ุงูู ุงูููู ู ุงูุชู ุชุนูู: ุงูู ูุฒูู .ูุฒูู - 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: 128num_train_epochs: 5warmup_steps: 0.1gradient_accumulation_steps: 2bf16: Truebatch_sampler: no_duplicates
All Hyperparameters
Click to expand
per_device_train_batch_size: 128num_train_epochs: 5max_steps: -1learning_rate: 5e-05lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.1optim: adamw_torch_fusedoptim_args: Noneweight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 2average_tokens_across_devices: Truemax_grad_norm: 1.0label_smoothing_factor: 0.0bf16: Truefp16: Falsebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Nonetorch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneuse_liger_kernel: Falseliger_kernel_config: Noneuse_cache: Falseneftune_noise_alpha: Nonetorch_empty_cache_steps: Noneauto_find_batch_size: Falselog_on_each_node: Truelogging_nan_inf_filter: Trueinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Falseproject: huggingfacetrackio_space_id: Nonetrackio_bucket_id: Nonetrackio_static_space_id: Noneper_device_eval_batch_size: 8prediction_loss_only: Trueeval_on_start: Falseeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: Noneinclude_for_metrics: []batch_eval_metrics: Falsesave_only_model: Falsesave_on_each_node: Falseenable_jit_checkpoint: Falsepush_to_hub: Falsehub_private_repo: Nonehub_model_id: Nonehub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Falseignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 42data_seed: Noneuse_cpu: Falseaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedataloader_drop_last: Falsedataloader_num_workers: 0dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_prefetch_factor: Noneremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_static_graph: Noneddp_backend: Noneddp_timeout: 1800fsdp: []fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}deepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonewarmup_ratio: Nonelocal_rank: -1prompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}
Training Logs
| Epoch | Step | Training Loss |
|---|---|---|
| 0.2821 | 100 | 1.8383 |
| 0.5642 | 200 | 1.3010 |
| 0.8463 | 300 | 1.1525 |
| 1.1269 | 400 | 0.9740 |
| 1.4090 | 500 | 0.8594 |
| 1.6911 | 600 | 0.8258 |
| 1.9732 | 700 | 0.8039 |
| 2.2539 | 800 | 0.6164 |
| 2.5360 | 900 | 0.6076 |
| 2.8181 | 1000 | 0.6035 |
| 3.0987 | 1100 | 0.5412 |
| 3.3808 | 1200 | 0.4620 |
| 3.6629 | 1300 | 0.4595 |
| 3.9450 | 1400 | 0.4667 |
| 4.2257 | 1500 | 0.4030 |
| 4.5078 | 1600 | 0.3940 |
| 4.7898 | 1700 | 0.3759 |
Training Time
- Training: 10.7 minutes
Framework Versions
- Python: 3.12.13
- Sentence Transformers: 5.5.1
- Transformers: 5.9.0
- PyTorch: 2.11.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},
}