CoolFace
Modelpublic

vsevolodl/qwen3-embed-v4-bashar_docs-192

sourceHugging Faceapache-2.0updated 10mo agoView on Hugging Face
0likes25downloads
Model Card

Qwen/Qwen3-Embedding-0.6B

This is a sentence-transformers model finetuned from Qwen/Qwen3-Embedding-0.6B. It maps sentences & paragraphs to a 1024-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: Qwen/Qwen3-Embedding-0.6B <!-- at revision c54f2e6e80b2d7b7de06f51cec4959f6b3e03418 -->
  • Maximum Sequence Length: 192 tokens
  • Output Dimensionality: 1024 dimensions
  • Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown -->
  • Language: multilingual
  • License: apache-2.0

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 192, 'do_lower_case': False, 'architecture': 'Qwen3Model'})
  (1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': True, '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("sentence_transformers_model_id")
# Run inference
queries = [
    "\u0645\u0627 \u0647\u064a \u0627\u0644\u0623\u0645\u0627\u0643\u0646 \u0627\u0644\u0623\u062e\u0631\u0649 \u0627\u0644\u0645\u0647\u0645\u0629 \u062f\u0627\u062e\u0644 \u062d\u062f\u0648\u062f \u0627\u0644\u062d\u0631\u0645 \u0627\u0644\u0645\u0643\u064a \u0627\u0644\u0634\u0631\u064a\u0641\u061f",
]
documents = [
    'نظيفا»() وذكر القاضي في حديث ابن عباس في «غسل النبي  قال فجففوه بثوب»(). \\n\\nوللتفصيل ينظر (ر: تكفين). \\n\\nالتنعيم \\n\\nالتعريف: \\n\\n1 - التنعيم موضع في الحل في شمال مكة الغربي، وهو حد الحرم من جهة المدينة المنورة. \\n\\nقال الفاسي: المسافة بين باب العمرة وبين أعلام الحرم في هذه الجهة التي في الأرض لا التي على الجبل اثنا عشر ألف ذراع وأربعمائة ذراع وعشرون ذراعا بذراع اليد(). \\n\\nوإنما سمي التنعيم بهذا الاسم لأن الجبل الذي عن يمين الداخل يقال له ناعم والذي عن اليسار يقال له منعم أو نعيم والوادي نعمان(). \\n\\nالأحكام المتعلقة بالتنعيم: \\n\\n2 - أجمع الفقهاء على أن المعتمر المكي لا بد له من',
    'الملك. \\n\\nونقل القاضي زكريا عن النووي في الروضة قوله: المختار أن كون الإبراء تمليكا أو إسقاطا من المسائل التي لا يطلق فيها ترجيح، بل يختلف الراجح بحسب المسائل، لقوة الدليل وضعفه؛ لأن الإبراء إنما يكون تمليكا باعتبار أن الدين مال، وهو إنما يكون مالا في حق من له الدين، فإن أحكام المالية إنما تظهر في حقه. \\n\\nومما غلب فيه معنى التمليك عند المالكية ترجيحهم اشتراط القبول في الإبراء، كما سيأتي(). \\n\\nعلى أن هناك ما يصلح بالاعتبارين (الإسقاط والتمليك بالتساوي). ومنه ما نص عليه الحنفية أنه لو أبرأ الوارث مدين مورثه غير عالم بموته، ثم بان ميتا، فبالنظر إلى أنه إسقاط يصح، وكذا بالنظر',
    'كفارا، ولم ينكر النبي  ذلك عليه(). \\n\\nأخذ الأجرة على التعاويذ والرقى: \\n\\n28 - ذهب جمهور الفقهاء إلى جواز أخذ الأجرة على التعاويذ والرقى، وإليه ذهب عطاء، وأبو قلابة، وأبو ثور، وإسحاق، واستدلوا بحديث أبي سعيد الخدري  الذي سبق ذكره (ف - 14) واستدل الطحاوي للجواز وقال: يجوز أخذ الأجر على الرقى، لأنه ليس على الناس أن يرقي بعضهم بعضا؛ لأن في ذلك تبليغا عن الله تعالى. وكره الزهري أخذ الأجرة على القرآن مطلقا، سواء أكان للتعليم أو للرقية(). \\n\\n\\n\\nتعويض \\n\\nالتعريف: \\n\\n1 - أصل التعويض لغة: العوض، وهو البدل تقول: عوضته تعويضا إذا أعطيته بدل ما ذهب منه. وتعوض منه واعتاض: أخذ العوض()',
]
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.3507, -0.0306, -0.0986]])

<!--

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

Evaluation

Metrics

Information Retrieval
json
  {
      "truncate_dim": 1024
  }
MetricValue
cosine_accuracy@10.3421
cosine_accuracy@30.4979
cosine_accuracy@50.562
cosine_accuracy@100.6452
cosine_precision@10.3421
cosine_precision@30.166
cosine_precision@50.1124
cosine_precision@100.0645
cosine_recall@10.3421
cosine_recall@30.4979
cosine_recall@50.562
cosine_recall@100.6452
cosine_ndcg@100.4867
cosine_mrr@100.4367
cosine_map@1000.4445
Information Retrieval
json
  {
      "truncate_dim": 256
  }
MetricValue
cosine_accuracy@10.2872
cosine_accuracy@30.4339
cosine_accuracy@50.5003
cosine_accuracy@100.5771
cosine_precision@10.2872
cosine_precision@30.1446
cosine_precision@50.1001
cosine_precision@100.0577
cosine_recall@10.2872
cosine_recall@30.4339
cosine_recall@50.5003
cosine_recall@100.5771
cosine_ndcg@100.4253
cosine_mrr@100.3774
cosine_map@1000.3862

<!--

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: 73,994 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: 3 tokens</li><li>mean: 24.27 tokens</li><li>max: 52 tokens</li></ul> | <ul><li>min: 192 tokens</li><li>mean: 192.0 tokens</li><li>max: 192 tokens</li></ul> |
  • Samples: | anchor | positive | |:----------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>What specific practices did this group of followers engage in according to the given text?</code> | <code>هذا الصنف من المتبعين قد كثر في العصور الأخيرة، فهم يعكفون على عبارات الكتب، لا يتجهون إلا إلى الالتقاط منها، من غير قصد لتعرف دليل ما \n\nيلتقطون، ويبنون عليه، بل يكتمون بأن يقولوا: هناك قول بهذا، وإن لم يكن له دليل قوي(). \n\nولقد كان لهذا الفريق أثران مختلفان: أحدهما خير، وهو ما يتعلق بالقضاء، فإنه إذا كان القضاء لا يصح إلا بالراجح من المذهب، فإن هؤلاء عملهم الاتباع لهذا الراجح، وفي ذلك ضبط للقضاء من غير أن يكون الأمر فرطا. وتقييد القضاء في الأزمان التي تنحرف فيها الأفكار واجب، بل إن الاتباع لا يكون حسنا إلا في الأحكام القضائية. \n\nالأثر الثاني: أن هذا فيه تقديس لأقوال</code> | | <code>How does this group's approach to understanding religious texts impact legal rulings, particularly in matters related to judicial decisions?</code> | <code>هذا الصنف من المتبعين قد كثر في العصور الأخيرة، فهم يعكفون على عبارات الكتب، لا يتجهون إلا إلى الالتقاط منها، من غير قصد لتعرف دليل ما \n\nيلتقطون، ويبنون عليه، بل يكتمون بأن يقولوا: هناك قول بهذا، وإن لم يكن له دليل قوي(). \n\nولقد كان لهذا الفريق أثران مختلفان: أحدهما خير، وهو ما يتعلق بالقضاء، فإنه إذا كان القضاء لا يصح إلا بالراجح من المذهب، فإن هؤلاء عملهم الاتباع لهذا الراجح، وفي ذلك ضبط للقضاء من غير أن يكون الأمر فرطا. وتقييد القضاء في الأزمان التي تنحرف فيها الأفكار واجب، بل إن الاتباع لا يكون حسنا إلا في الأحكام القضائية. \n\nالأثر الثاني: أن هذا فيه تقديس لأقوال</code> | | <code>Can you explain the two contrasting effects mentioned for this group's methodology?</code> | <code>هذا الصنف من المتبعين قد كثر في العصور الأخيرة، فهم يعكفون على عبارات الكتب، لا يتجهون إلا إلى الالتقاط منها، من غير قصد لتعرف دليل ما \n\nيلتقطون، ويبنون عليه، بل يكتمون بأن يقولوا: هناك قول بهذا، وإن لم يكن له دليل قوي(). \n\nولقد كان لهذا الفريق أثران مختلفان: أحدهما خير، وهو ما يتعلق بالقضاء، فإنه إذا كان القضاء لا يصح إلا بالراجح من المذهب، فإن هؤلاء عملهم الاتباع لهذا الراجح، وفي ذلك ضبط للقضاء من غير أن يكون الأمر فرطا. وتقييد القضاء في الأزمان التي تنحرف فيها الأفكار واجب، بل إن الاتباع لا يكون حسنا إلا في الأحكام القضائية. \n\nالأثر الثاني: أن هذا فيه تقديس لأقوال</code> |
  • Loss: <code>MatryoshkaLoss</code> with these parameters:
json
  {
      "loss": "MultipleNegativesRankingLoss",
      "matryoshka_dims": [
          1024,
          256
      ],
      "matryoshka_weights": [
          1,
          1
      ],
      "n_dims_per_step": -1
  }

Training Hyperparameters

Non-Default Hyperparameters
  • eval_strategy: steps
  • per_device_train_batch_size: 128
  • per_device_eval_batch_size: 64
  • gradient_accumulation_steps: 2
  • learning_rate: 2e-05
  • num_train_epochs: 2
  • lr_scheduler_type: cosine
  • warmup_ratio: 0.1
  • bf16: True
  • tf32: True
  • load_best_model_at_end: True
  • gradient_checkpointing: True
  • batch_sampler: no_duplicates
All Hyperparameters

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

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 128
  • per_device_eval_batch_size: 64
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 2
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 2e-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: 2
  • max_steps: -1
  • lr_scheduler_type: cosine
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.1
  • 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
  • bf16: True
  • fp16: False
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: True
  • 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: True
  • 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}
  • parallelism_config: None
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamwtorchfused
  • optim_args: None
  • adafactor: False
  • 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
  • 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
  • hub_revision: None
  • gradient_checkpointing: True
  • 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
  • include_tokens_per_second: False
  • 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
  • prompts: None
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

</details>

Training Logs

EpochStepTraining Lossdim_1024_cosine_ndcg@10dim_256_cosine_ndcg@10
-1-1-0.37650.3060
0.0345103.2088--
0.0691202.879--
0.1036302.4085--
0.1382402.0405--
0.1727501.87850.43110.3651
0.2073601.7366--
0.2418701.6183--
0.2763801.5751--
0.3109901.3818--
0.34541001.46480.46360.3970
0.38001101.4749--
0.41451201.4677--
0.44911301.3521--
0.48361401.302--
0.51811501.33150.46750.4084
0.55271601.3341--
0.58721701.3045--
0.62181801.3123--
0.65631901.2239--
0.69082001.21580.47550.4160
0.72542101.286--
0.75992201.207--
0.79452301.1968--
0.82902401.2546--
0.86362501.10380.48270.4226
0.89812601.1658--
0.93262701.1338--
0.96722801.0918--
1.02901.0354--
1.03453000.98160.48790.427
1.06913100.9749--
1.10363200.9743--
1.13823300.905--
1.17273400.9706--
1.20733500.90170.48660.4252
1.24183600.9318--
1.27633700.9577--
1.31093800.9529--
1.34543900.9866--
1.38004000.96960.48630.4243
1.41454100.9322--
1.44914200.9313--
1.48364300.9352--
1.51814400.9885--
1.55274500.8730.48640.4254
1.58724600.9204--
1.62184700.9117--
1.65634800.8663--
1.69084900.9397--
1.72545000.86240.48730.4259
1.75995100.91--
1.79455200.9202--
1.82905300.9903--
1.86365400.8564--
1.89815500.95940.48670.4253
1.93265600.9858--
1.96725700.9477--
2.05800.9216--
  • The bold row denotes the saved checkpoint.

Framework Versions

  • Python: 3.12.0
  • Sentence Transformers: 5.1.2
  • Transformers: 4.57.1
  • PyTorch: 2.8.0+cu128
  • Accelerate: 1.11.0
  • Datasets: 4.4.1
  • Tokenizers: 0.22.1

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",
}
MatryoshkaLoss
bibtex
@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
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. -->