CoolFace
Modelpublic

leafxyz/main

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes
Model Card

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 pairswithnegatives 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 <!-- at revision 80f273fd53c6644d65e14a2ac1fbf74b8c924097 -->
  • —Maximum Sequence Length: 64 tokens
  • —Output Dimensionality: 1024 dimensions
  • —Similarity Function: Cosine Similarity
  • —Supported Modality: Text
  • —Training Datasets:
  • —pairswithnegatives
  • —positives <!-- - Language: Unknown --> <!-- - License: Unknown -->

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:

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("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]])

<!--

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 Datasets

pairswithnegatives
  • —Dataset: pairswithnegatives
  • —Size: 23,680 training samples
  • —Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
  • —Approximate statistics based on the first 1000 samples: | | anchor | positive | negative | |:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | string | | details | <ul><li>min: 23 tokens</li><li>mean: 29.53 tokens</li><li>max: 41 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 15.91 tokens</li><li>max: 40 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 15.13 tokens</li><li>max: 38 tokens</li></ul> |
  • —Samples: | anchor | positive | negative | |:----------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------|:-------------------------------------| | <code>Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it<br>Query: صدر دجاج كمون</code> | <code>صدر دجاج بالعظم</code> | <code>صدر دجاج مجمد - الاولى</code> | | <code>Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it<br>Query: حليب</code> | <code>حليب الزهرات - 410 غ</code> | <code>بدلة نسائية - 051</code> | | <code>Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it<br>Query: عصائر</code> | <code>عصير بيلو برتقال - 330 غ</code> | <code>D5699-زي تنكري </code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "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: <code>anchor</code> and <code>positive</code>
  • —Approximate statistics based on the first 1000 samples: | | anchor | positive | |:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 23 tokens</li><li>mean: 29.41 tokens</li><li>max: 41 tokens</li></ul> | <ul><li>min: 2 tokens</li><li>mean: 13.66 tokens</li><li>max: 36 tokens</li></ul> |
  • —Samples: | anchor | positive | |:---------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------| | <code>Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it<br>Query: نحب مكرونة خرز</code> | <code>مكرونة خرز 2</code> | | <code>Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it<br>Query: نحب حذاء افراح فضي</code> | <code>حذاء افراح - 5142wo</code> | | <code>Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it<br>Query: بودرة بدون عطور</code> | <code>Baby Powder - Nunu</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "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

pairswithnegatives
  • —Dataset: pairswithnegatives
  • —Size: 240 evaluation samples
  • —Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
  • —Approximate statistics based on the first 240 samples: | | anchor | positive | negative | |:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | string | | details | <ul><li>min: 24 tokens</li><li>mean: 29.85 tokens</li><li>max: 41 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 16.65 tokens</li><li>max: 40 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 15.61 tokens</li><li>max: 33 tokens</li></ul> |
  • —Samples: | anchor | positive | negative | |:------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------|:-----------------------------------------------------| | <code>Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it<br>Query: سماعات لاسلكية</code> | <code>سماعات بلوتوث - Moxom</code> | <code>كريم مزيل عرق بالجلسرين - Roncey</code> | | <code>Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it<br>Query: نشتي تابل فلفل</code> | <code>تابل كارمنسيتا 4 انواع فلفل مطحنة - 145 غ</code> | <code>تابل كارمنسيتا فلفل اسود حب مطحنة -47 غ</code> | | <code>Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it<br>Query: صلصة تريكي حدائق سويسرا 250</code> | <code>صلصة التريكي حدائق سويسرا - 250 مل</code> | <code>صلصة وسترشاير حدائق سويسرا - 250 مل</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "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: <code>anchor</code> and <code>positive</code>
  • —Approximate statistics based on the first 1000 samples: | | anchor | positive | |:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 23 tokens</li><li>mean: 29.35 tokens</li><li>max: 45 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 13.76 tokens</li><li>max: 37 tokens</li></ul> |
  • —Samples: | anchor | positive | |:----------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------| | <code>Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it<br>Query: كفر</code> | <code>كفر - 876</code> | | <code>Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it<br>Query: بيرير شعير</code> | <code>بيرير شعير 330ملي</code> | | <code>Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it<br>Query: مكيف هواء 01 1.5 طن</code> | <code>مكيف هواء - 01</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "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

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

  • —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: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • —accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • —parallelism_config: None
  • —deepspeed: None
  • —label_smoothing_factor: 0.0
  • —optim: adamwtorchfused
  • —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: {}

</details>

Training Logs

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

EpochStepTraining Losspairs with negatives losspositives loss
0.0062250.3026--
0.0124500.2774--
0.0186750.2329--
0.02491000.3215--
0.03111250.2840--
0.03731500.2273--
0.04351750.2653--
0.04972000.29540.49500.1348
0.05592250.2065--
0.06222500.2829--
0.06842750.3483--
0.07463000.2630--
0.08083250.2213--
0.08703500.2100--
0.09323750.1968--
0.09954000.27570.48390.1207
0.10574250.2429--
0.11194500.2036--
0.11814750.2323--
0.12435000.2300--
0.13055250.2574--
0.13675500.1876--
0.14305750.2610--
0.14926000.18210.46100.1138
0.15546250.2224--
0.16166500.2094--
0.16786750.2207--
0.17407000.2337--
0.18037250.2254--
0.18657500.1587--
0.19277750.2680--
0.19898000.23290.42870.1062
0.20518250.1858--
0.21138500.2216--
0.21768750.1858--
0.22389000.2059--
0.23009250.2509--
0.23629500.2116--
0.24249750.2355--
0.248610000.20780.42430.0990
0.254810250.2096--
0.261110500.1906--
0.267310750.2119--
0.273511000.2264--
0.279711250.1925--
0.285911500.1925--
0.292111750.1872--
0.298412000.20920.42050.0944
0.304612250.2271--
0.310812500.1920--
0.317012750.2476--
0.323213000.2103--
0.329413250.1690--
0.335713500.1838--
0.341913750.1581--
0.348114000.20450.40760.0892
0.354314250.1498--
0.360514500.2218--
0.366714750.1973--
0.372915000.1979--
0.379215250.1658--
0.385415500.2064--
0.391615750.2152--
0.397816000.23690.40150.0870
0.404016250.2124--
0.410216500.1714--
0.416516750.1537--
0.422717000.1945--
0.428917250.1481--
0.435117500.1522--
0.441317750.1983--
0.447518000.16360.41060.0826
0.453818250.1199--
0.460018500.1897--
0.466218750.2022--
0.472419000.1831--
0.478619250.1973--
0.484819500.1378--
0.491019750.1843--
0.497320000.18230.39300.0851
0.503520250.1733--
0.509720500.1825--
0.515920750.1704--
0.522121000.1721--
0.528321250.2249--
0.534621500.1580--
0.540821750.1572--
0.547022000.15450.39990.0811
0.553222250.1840--
0.559422500.1930--
0.565622750.1541--
0.571923000.1881--
0.578123250.1268--
0.584323500.1661--
0.590523750.1613--
0.596724000.16620.40010.0775
0.602924250.2088--
0.609124500.1483--
0.615424750.1487--
0.621625000.1636--
0.627825250.1632--
0.634025500.1878--
0.640225750.2039--
0.646426000.17540.38910.0750
0.652726250.1898--
0.658926500.1902--
0.665126750.1900--
0.671327000.1797--
0.677527250.1806--
0.683727500.1478--
0.690027750.1667--
0.696228000.14710.38650.0731
0.702428250.1262--
0.708628500.1921--
0.714828750.1559--
0.721029000.1194--
0.727329250.1569--
0.733529500.1295--
0.739729750.1444--
0.745930000.16670.38770.0723
0.752130250.1636--
0.758330500.1669--
0.764530750.1424--
0.770831000.1300--
0.777031250.1584--
0.783231500.1857--
0.789431750.1787--
0.795632000.17100.37730.0718
0.801832250.1579--
0.808132500.1875--
0.814332750.1241--
0.820533000.1421--
0.826733250.1767--
0.832933500.1506--
0.839133750.1519--
0.845434000.14040.37840.0710
0.851634250.1597--
0.857834500.1692--
0.864034750.1806--
0.870235000.1635--
0.876435250.1924--
0.882635500.1493--
0.888935750.1444--
0.895136000.16640.37930.0710
0.901336250.1612--
0.907536500.1231--
0.913736750.1670--
0.919937000.1440--
0.926237250.1956--
0.932437500.1827--
0.938637750.1263--
0.944838000.15200.37620.0699
0.951038250.1412--
0.957238500.1800--
0.963538750.1551--
0.969739000.1345--
0.975939250.1644--
0.982139500.0972--
0.988339750.1284--
0.994540000.13770.37460.0697

</details>

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
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{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},
}

<!--

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. -->