SentenceTransformer based on prestoai/qwen3-embedding-0.6b-arabic-ecom

This is a sentence-transformers model finetuned from prestoai/qwen3-embedding-0.6b-arabic-ecom on the pairs_with_negatives and positives datasets. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for retrieval.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: prestoai/qwen3-embedding-0.6b-arabic-ecom
  • Maximum Sequence Length: 64 tokens
  • Output Dimensionality: 1024 dimensions
  • Similarity Function: Cosine Similarity
  • Supported Modality: Text
  • Training Datasets:
    • pairs_with_negatives
    • positives

Model Sources

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': 'Qwen3Model'})
  (1): Pooling({'embedding_dimension': 1024, 'pooling_mode': 'lasttoken', 'include_prompt': True})
  (2): Normalize({})
)

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("leafxyz/main")
# Run inference
queries = [
    'Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it\nQuery: شاحن ايفون BAVIN',
]
documents = [
    'كابل شحن ايفون  BAVIN - 2.4A CB-015',
    'كابل شحن تايب سي BAVIN -  2.4A',
    'مزيل طلاء اظافر  04 - Acetone',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 1024] [3, 1024]

# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[ 0.6069,  0.4563, -0.0245]])

Training Details

Training Datasets

pairs_with_negatives

  • Dataset: pairs_with_negatives
  • Size: 23,680 training samples
  • Columns: anchor, positive, and negative
  • Approximate statistics based on the first 1000 samples:
    anchor positive negative
    type string string string
    details
    • min: 23 tokens
    • mean: 29.53 tokens
    • max: 41 tokens
    • min: 3 tokens
    • mean: 15.91 tokens
    • max: 40 tokens
    • min: 3 tokens
    • mean: 15.13 tokens
    • max: 38 tokens
  • Samples:
    anchor positive negative
    Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
    Query: صدر دجاج كمون
    صدر دجاج بالعظم صدر دجاج مجمد - الاولى
    Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
    Query: حليب
    حليب الزهرات - 410 غ بدلة نسائية - 051
    Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
    Query: عصائر
    عصير بيلو برتقال - 330 غ D5699-زي تنكري
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false,
        "directions": [
            "query_to_doc"
        ],
        "partition_mode": "joint",
        "hardness_mode": null,
        "hardness_strength": 0.0
    }
    

positives

  • Dataset: positives
  • Size: 105,019 training samples
  • Columns: anchor and positive
  • Approximate statistics based on the first 1000 samples:
    anchor positive
    type string string
    details
    • min: 23 tokens
    • mean: 29.41 tokens
    • max: 41 tokens
    • min: 2 tokens
    • mean: 13.66 tokens
    • max: 36 tokens
  • Samples:
    anchor positive
    Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
    Query: نحب مكرونة خرز
    مكرونة خرز 2
    Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
    Query: نحب حذاء افراح فضي
    حذاء افراح - 5142wo
    Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
    Query: بودرة بدون عطور
    Baby Powder - Nunu
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false,
        "directions": [
            "query_to_doc"
        ],
        "partition_mode": "joint",
        "hardness_mode": null,
        "hardness_strength": 0.0
    }
    

Evaluation Datasets

pairs_with_negatives

  • Dataset: pairs_with_negatives
  • Size: 240 evaluation samples
  • Columns: anchor, positive, and negative
  • Approximate statistics based on the first 240 samples:
    anchor positive negative
    type string string string
    details
    • min: 24 tokens
    • mean: 29.85 tokens
    • max: 41 tokens
    • min: 3 tokens
    • mean: 16.65 tokens
    • max: 40 tokens
    • min: 3 tokens
    • mean: 15.61 tokens
    • max: 33 tokens
  • Samples:
    anchor positive negative
    Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
    Query: سماعات لاسلكية
    سماعات بلوتوث - Moxom كريم مزيل عرق بالجلسرين - Roncey
    Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
    Query: نشتي تابل فلفل
    تابل كارمنسيتا 4 انواع فلفل مطحنة - 145 غ تابل كارمنسيتا فلفل اسود حب مطحنة -47 غ
    Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
    Query: صلصة تريكي حدائق سويسرا 250
    صلصة التريكي حدائق سويسرا - 250 مل صلصة وسترشاير حدائق سويسرا - 250 مل
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false,
        "directions": [
            "query_to_doc"
        ],
        "partition_mode": "joint",
        "hardness_mode": null,
        "hardness_strength": 0.0
    }
    

positives

  • Dataset: positives
  • Size: 1,061 evaluation samples
  • Columns: anchor and positive
  • Approximate statistics based on the first 1000 samples:
    anchor positive
    type string string
    details
    • min: 23 tokens
    • mean: 29.35 tokens
    • max: 45 tokens
    • min: 3 tokens
    • mean: 13.76 tokens
    • max: 37 tokens
  • Samples:
    anchor positive
    Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
    Query: كفر
    كفر - 876
    Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
    Query: بيرير شعير
    بيرير شعير 330ملي
    Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
    Query: مكيف هواء 01 1.5 طن
    مكيف هواء - 01
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false,
        "directions": [
            "query_to_doc"
        ],
        "partition_mode": "joint",
        "hardness_mode": null,
        "hardness_strength": 0.0
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 16
  • gradient_accumulation_steps: 2
  • learning_rate: 3e-05
  • num_train_epochs: 1
  • warmup_steps: 0.05
  • fp16: True

All Hyperparameters

Click to expand
  • do_predict: False
  • prediction_loss_only: True
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 8
  • gradient_accumulation_steps: 2
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 3e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 1
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: None
  • warmup_ratio: None
  • warmup_steps: 0.05
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • enable_jit_checkpoint: False
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • use_cpu: False
  • seed: 42
  • data_seed: None
  • bf16: False
  • fp16: True
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: -1
  • ddp_backend: None
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • 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: None
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch_fused
  • optim_args: None
  • group_by_length: False
  • length_column_name: length
  • project: huggingface
  • trackio_space_id: trackio
  • 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
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: None
  • hub_always_push: False
  • hub_revision: None
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_for_metrics: []
  • eval_do_concat_batches: True
  • auto_find_batch_size: False
  • full_determinism: False
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • include_num_input_tokens_seen: no
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • liger_kernel_config: None
  • eval_use_gather_object: False
  • average_tokens_across_devices: True
  • use_cache: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Click to expand
Epoch Step Training Loss pairs with negatives loss positives loss
0.0062 25 0.3026 - -
0.0124 50 0.2774 - -
0.0186 75 0.2329 - -
0.0249 100 0.3215 - -
0.0311 125 0.2840 - -
0.0373 150 0.2273 - -
0.0435 175 0.2653 - -
0.0497 200 0.2954 0.4950 0.1348
0.0559 225 0.2065 - -
0.0622 250 0.2829 - -
0.0684 275 0.3483 - -
0.0746 300 0.2630 - -
0.0808 325 0.2213 - -
0.0870 350 0.2100 - -
0.0932 375 0.1968 - -
0.0995 400 0.2757 0.4839 0.1207
0.1057 425 0.2429 - -
0.1119 450 0.2036 - -
0.1181 475 0.2323 - -
0.1243 500 0.2300 - -
0.1305 525 0.2574 - -
0.1367 550 0.1876 - -
0.1430 575 0.2610 - -
0.1492 600 0.1821 0.4610 0.1138
0.1554 625 0.2224 - -
0.1616 650 0.2094 - -
0.1678 675 0.2207 - -
0.1740 700 0.2337 - -
0.1803 725 0.2254 - -
0.1865 750 0.1587 - -
0.1927 775 0.2680 - -
0.1989 800 0.2329 0.4287 0.1062
0.2051 825 0.1858 - -
0.2113 850 0.2216 - -
0.2176 875 0.1858 - -
0.2238 900 0.2059 - -
0.2300 925 0.2509 - -
0.2362 950 0.2116 - -
0.2424 975 0.2355 - -
0.2486 1000 0.2078 0.4243 0.0990
0.2548 1025 0.2096 - -
0.2611 1050 0.1906 - -
0.2673 1075 0.2119 - -
0.2735 1100 0.2264 - -
0.2797 1125 0.1925 - -
0.2859 1150 0.1925 - -
0.2921 1175 0.1872 - -
0.2984 1200 0.2092 0.4205 0.0944
0.3046 1225 0.2271 - -
0.3108 1250 0.1920 - -
0.3170 1275 0.2476 - -
0.3232 1300 0.2103 - -
0.3294 1325 0.1690 - -
0.3357 1350 0.1838 - -
0.3419 1375 0.1581 - -
0.3481 1400 0.2045 0.4076 0.0892
0.3543 1425 0.1498 - -
0.3605 1450 0.2218 - -
0.3667 1475 0.1973 - -
0.3729 1500 0.1979 - -
0.3792 1525 0.1658 - -
0.3854 1550 0.2064 - -
0.3916 1575 0.2152 - -
0.3978 1600 0.2369 0.4015 0.0870
0.4040 1625 0.2124 - -
0.4102 1650 0.1714 - -
0.4165 1675 0.1537 - -
0.4227 1700 0.1945 - -
0.4289 1725 0.1481 - -
0.4351 1750 0.1522 - -
0.4413 1775 0.1983 - -
0.4475 1800 0.1636 0.4106 0.0826
0.4538 1825 0.1199 - -
0.4600 1850 0.1897 - -
0.4662 1875 0.2022 - -
0.4724 1900 0.1831 - -
0.4786 1925 0.1973 - -
0.4848 1950 0.1378 - -
0.4910 1975 0.1843 - -
0.4973 2000 0.1823 0.3930 0.0851
0.5035 2025 0.1733 - -
0.5097 2050 0.1825 - -
0.5159 2075 0.1704 - -
0.5221 2100 0.1721 - -
0.5283 2125 0.2249 - -
0.5346 2150 0.1580 - -
0.5408 2175 0.1572 - -
0.5470 2200 0.1545 0.3999 0.0811
0.5532 2225 0.1840 - -
0.5594 2250 0.1930 - -
0.5656 2275 0.1541 - -
0.5719 2300 0.1881 - -
0.5781 2325 0.1268 - -
0.5843 2350 0.1661 - -
0.5905 2375 0.1613 - -
0.5967 2400 0.1662 0.4001 0.0775
0.6029 2425 0.2088 - -
0.6091 2450 0.1483 - -
0.6154 2475 0.1487 - -
0.6216 2500 0.1636 - -
0.6278 2525 0.1632 - -
0.6340 2550 0.1878 - -
0.6402 2575 0.2039 - -
0.6464 2600 0.1754 0.3891 0.0750
0.6527 2625 0.1898 - -
0.6589 2650 0.1902 - -
0.6651 2675 0.1900 - -
0.6713 2700 0.1797 - -
0.6775 2725 0.1806 - -
0.6837 2750 0.1478 - -
0.6900 2775 0.1667 - -
0.6962 2800 0.1471 0.3865 0.0731
0.7024 2825 0.1262 - -
0.7086 2850 0.1921 - -
0.7148 2875 0.1559 - -
0.7210 2900 0.1194 - -
0.7273 2925 0.1569 - -
0.7335 2950 0.1295 - -
0.7397 2975 0.1444 - -
0.7459 3000 0.1667 0.3877 0.0723
0.7521 3025 0.1636 - -
0.7583 3050 0.1669 - -
0.7645 3075 0.1424 - -
0.7708 3100 0.1300 - -
0.7770 3125 0.1584 - -
0.7832 3150 0.1857 - -
0.7894 3175 0.1787 - -
0.7956 3200 0.1710 0.3773 0.0718
0.8018 3225 0.1579 - -
0.8081 3250 0.1875 - -
0.8143 3275 0.1241 - -
0.8205 3300 0.1421 - -
0.8267 3325 0.1767 - -
0.8329 3350 0.1506 - -
0.8391 3375 0.1519 - -
0.8454 3400 0.1404 0.3784 0.0710
0.8516 3425 0.1597 - -
0.8578 3450 0.1692 - -
0.8640 3475 0.1806 - -
0.8702 3500 0.1635 - -
0.8764 3525 0.1924 - -
0.8826 3550 0.1493 - -
0.8889 3575 0.1444 - -
0.8951 3600 0.1664 0.3793 0.0710
0.9013 3625 0.1612 - -
0.9075 3650 0.1231 - -
0.9137 3675 0.1670 - -
0.9199 3700 0.1440 - -
0.9262 3725 0.1956 - -
0.9324 3750 0.1827 - -
0.9386 3775 0.1263 - -
0.9448 3800 0.1520 0.3762 0.0699
0.9510 3825 0.1412 - -
0.9572 3850 0.1800 - -
0.9635 3875 0.1551 - -
0.9697 3900 0.1345 - -
0.9759 3925 0.1644 - -
0.9821 3950 0.0972 - -
0.9883 3975 0.1284 - -
0.9945 4000 0.1377 0.3746 0.0697

Training Time

  • Training: 1.5 hours

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: 5.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",
}

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},
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for leafxyz/main

Papers for leafxyz/main