|
|
--- |
|
|
tags: |
|
|
- sentence-transformers |
|
|
- sentence-similarity |
|
|
- feature-extraction |
|
|
- dense |
|
|
- generated_from_trainer |
|
|
- dataset_size:8914 |
|
|
- loss:MultipleNegativesRankingLoss |
|
|
base_model: Qwen/Qwen3-Embedding-0.6B |
|
|
widget: |
|
|
- source_sentence: Киноа черная Esoro |
|
|
sentences: |
|
|
- 'Киноа черная ESORO, Перу, дойпак, 500г*35 (Штук/ящ: [35], Вес в кг: [0.500]' |
|
|
- 'Кунжут белый очищенный нежареный, HANSEY, Россия, 1кг*15 (Штук/ящ: [8], Вес в |
|
|
кг: [1.000]' |
|
|
- Киноа белая Esoro |
|
|
- source_sentence: original чипсы нори tidori |
|
|
sentences: |
|
|
- 'Чипсы нори TIDORI, Корея, Original, 15г (5г х 3) * 24 (Штук/ящ: [24], Вес в кг: |
|
|
[0.038]' |
|
|
- Kimchi Чипсы нори Tidori |
|
|
- Свитшот мужской оверсайзтолстовка |
|
|
- source_sentence: Перчатки одноразовые ТПЭ |
|
|
sentences: |
|
|
- Салфетка настольная, ПВХ (серебро) |
|
|
- 'перчатки одноразовые тпэ, размер м, китай, 200шт*10 (штук/ящ: [10], вес в кг: |
|
|
[0.450]' |
|
|
- Костюмженскийдомашнийсбрюками |
|
|
- source_sentence: Спортивный костюм женский/с худи/утепленный из футера с начесом |
|
|
и капюшоном |
|
|
sentences: |
|
|
- 'Соус сладкий чили Лемонграсс Suree, Таиланд, 435мл*12 (Штук/ящ: [12], Вес в кг: |
|
|
[0.569]' |
|
|
- Капор женский капюшон съемный шапка |
|
|
- Спортвный костюмженский/схуди/утепленнй из футера с начсом и капюшоном |
|
|
- source_sentence: Одежда для новорожденных мальчиков слип для малышей комбинезон |
|
|
нарядный нательный для фотосессии |
|
|
sentences: |
|
|
- Шапка детская для мальчика и снуд |
|
|
- ТелескопРефрактор/Детский игровойнабор |
|
|
- Одежда для новорожденных мальчиков слипдля малышей комбинезон нарядный нательный |
|
|
для фотосесии |
|
|
pipeline_tag: sentence-similarity |
|
|
library_name: sentence-transformers |
|
|
metrics: |
|
|
- cosine_accuracy |
|
|
model-index: |
|
|
- name: SentenceTransformer based on Qwen/Qwen3-Embedding-0.6B |
|
|
results: |
|
|
- task: |
|
|
type: triplet |
|
|
name: Triplet |
|
|
dataset: |
|
|
name: dev |
|
|
type: dev |
|
|
metrics: |
|
|
- type: cosine_accuracy |
|
|
value: 0.942307710647583 |
|
|
name: Cosine Accuracy |
|
|
--- |
|
|
|
|
|
# SentenceTransformer based on Qwen/Qwen3-Embedding-0.6B |
|
|
|
|
|
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [Qwen/Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B) on the data1 dataset. 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](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B) <!-- at revision c54f2e6e80b2d7b7de06f51cec4959f6b3e03418 --> |
|
|
- **Maximum Sequence Length:** 32768 tokens |
|
|
- **Output Dimensionality:** 1024 dimensions |
|
|
- **Similarity Function:** Cosine Similarity |
|
|
- **Training Dataset:** |
|
|
- data1 |
|
|
<!-- - **Language:** Unknown --> |
|
|
<!-- - **License:** Unknown --> |
|
|
|
|
|
### Model Sources |
|
|
|
|
|
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net) |
|
|
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers) |
|
|
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers) |
|
|
|
|
|
### Full Model Architecture |
|
|
|
|
|
``` |
|
|
SentenceTransformer( |
|
|
(0): Transformer({'max_seq_length': 32768, '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("gromoboy/qwen3_06b_items_matcher") |
|
|
# Run inference |
|
|
queries = [ |
|
|
"\u041e\u0434\u0435\u0436\u0434\u0430 \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0440\u043e\u0436\u0434\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u043b\u044c\u0447\u0438\u043a\u043e\u0432 \u0441\u043b\u0438\u043f \u0434\u043b\u044f \u043c\u0430\u043b\u044b\u0448\u0435\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0435\u0437\u043e\u043d \u043d\u0430\u0440\u044f\u0434\u043d\u044b\u0439 \u043d\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u043b\u044f \u0444\u043e\u0442\u043e\u0441\u0435\u0441\u0441\u0438\u0438", |
|
|
] |
|
|
documents = [ |
|
|
'Одежда для новорожденных мальчиков слипдля малышей комбинезон нарядный нательный для фотосесии', |
|
|
'Шапка детская для мальчика и снуд', |
|
|
'ТелескопРефрактор/Детский игровойнабор', |
|
|
] |
|
|
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.9531, 0.2704, 0.1847]]) |
|
|
``` |
|
|
|
|
|
<!-- |
|
|
### 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 |
|
|
|
|
|
#### Triplet |
|
|
|
|
|
* Dataset: `dev` |
|
|
* Evaluated with [<code>TripletEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.TripletEvaluator) with these parameters: |
|
|
```json |
|
|
{ |
|
|
"margin": { |
|
|
"cosine": 0.3, |
|
|
"dot": 0.3, |
|
|
"manhattan": 0.3, |
|
|
"euclidean": 0.3 |
|
|
} |
|
|
} |
|
|
``` |
|
|
|
|
|
| Metric | Value | |
|
|
|:--------------------|:-----------| |
|
|
| **cosine_accuracy** | **0.9423** | |
|
|
|
|
|
<!-- |
|
|
## 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 |
|
|
|
|
|
#### data1 |
|
|
|
|
|
* Dataset: data1 |
|
|
* Size: 8,914 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: 6 tokens</li><li>mean: 14.74 tokens</li><li>max: 46 tokens</li></ul> | <ul><li>min: 36 tokens</li><li>mean: 51.42 tokens</li><li>max: 86 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 14.61 tokens</li><li>max: 46 tokens</li></ul> | |
|
|
* Samples: |
|
|
| anchor | positive | negative | |
|
|
|:--------------------------------------|:---------------------------------------------------------------------------------------------------|:----------------------------------------| |
|
|
| <code>Cоуc рыбный Cook&Lobster</code> | <code>Соус рыбный, Таиланд 750мл*12 ,стекло (Штук/ящ: [12], Вес в кг: [1.448]</code> | <code>Соус устричный Genso</code> | |
|
|
| <code>Cоуc рыбный Cook&Lobster</code> | <code>Соус рыбный, Таиланд, 700мл*12 (Штук/ящ: [12], Вес в кг: [1.250]</code> | <code>Соус устричный Genso</code> | |
|
|
| <code>Kimchi Чипсы нори Tidori</code> | <code>Чипсы нори TIDORI, Корея, Kimchi, 15г (5г х 3) * 24 (Штук/ящ: [24], Вес в кг: [0.038]</code> | <code>Original Чипсы нори Tidori</code> | |
|
|
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters: |
|
|
```json |
|
|
{ |
|
|
"scale": 25, |
|
|
"similarity_fct": "cos_sim" |
|
|
} |
|
|
``` |
|
|
|
|
|
### Evaluation Dataset |
|
|
|
|
|
#### data1 |
|
|
|
|
|
* Dataset: data1 |
|
|
* Size: 2,288 evaluation 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: 6 tokens</li><li>mean: 19.04 tokens</li><li>max: 83 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 34.31 tokens</li><li>max: 88 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 18.38 tokens</li><li>max: 100 tokens</li></ul> | |
|
|
* Samples: |
|
|
| anchor | positive | negative | |
|
|
|:------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------| |
|
|
| <code>BBQ Чипсы нори Tidori</code> | <code>Чипсы нори TIDORI, Корея, BBQ, 15г (5г х 3) * 24 (Штук/ящ: [24], Вес в кг: [0.038]</code> | <code>Kimchi Чипсы нори Tidori</code> | |
|
|
| <code>Original Чипсы нори Tidori</code> | <code>Чипсы нори TIDORI, Корея, Original, 15г (5г х 3) * 24 (Штук/ящ: [24], Вес в кг: [0.038]</code> | <code>Kimchi Чипсы нори Tidori</code> | |
|
|
| <code>Авокадо пюре десертное с кокосом, голубикой и сиропом агавы, быстрозамороженное, блок (57 г*4)</code> | <code>Авокадо пюре десерт. с КОКОСОМ, ГОЛУБИКОЙ и сиропом агавы, быстрозамороженный 227гр*12 блок (57гр*4) (Штук/ящ: [12], Вес в кг: [0.235]</code> | <code>Авокадо пюре с киви, мятой и сиропом агавы, быстрозамороженное, блок (57 г*4)</code> | |
|
|
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters: |
|
|
```json |
|
|
{ |
|
|
"scale": 25, |
|
|
"similarity_fct": "cos_sim" |
|
|
} |
|
|
``` |
|
|
|
|
|
### Training Hyperparameters |
|
|
#### Non-Default Hyperparameters |
|
|
|
|
|
- `eval_strategy`: steps |
|
|
- `per_device_train_batch_size`: 32 |
|
|
- `per_device_eval_batch_size`: 32 |
|
|
- `learning_rate`: 2e-05 |
|
|
- `num_train_epochs`: 5 |
|
|
- `warmup_ratio`: 0.1 |
|
|
- `fp16`: 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`: 32 |
|
|
- `per_device_eval_batch_size`: 32 |
|
|
- `per_gpu_train_batch_size`: None |
|
|
- `per_gpu_eval_batch_size`: None |
|
|
- `gradient_accumulation_steps`: 1 |
|
|
- `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`: 5 |
|
|
- `max_steps`: -1 |
|
|
- `lr_scheduler_type`: linear |
|
|
- `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 |
|
|
- `use_ipex`: False |
|
|
- `bf16`: False |
|
|
- `fp16`: True |
|
|
- `fp16_opt_level`: O1 |
|
|
- `half_precision_backend`: auto |
|
|
- `bf16_full_eval`: False |
|
|
- `fp16_full_eval`: False |
|
|
- `tf32`: None |
|
|
- `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`: False |
|
|
- `ignore_data_skip`: False |
|
|
- `fsdp`: [] |
|
|
- `fsdp_min_num_params`: 0 |
|
|
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False} |
|
|
- `fsdp_transformer_layer_cls_to_wrap`: None |
|
|
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None} |
|
|
- `deepspeed`: None |
|
|
- `label_smoothing_factor`: 0.0 |
|
|
- `optim`: adamw_torch |
|
|
- `optim_args`: None |
|
|
- `adafactor`: False |
|
|
- `group_by_length`: False |
|
|
- `length_column_name`: length |
|
|
- `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`: False |
|
|
- `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`: False |
|
|
- `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`: False |
|
|
- `prompts`: None |
|
|
- `batch_sampler`: no_duplicates |
|
|
- `multi_dataset_batch_sampler`: proportional |
|
|
- `router_mapping`: {} |
|
|
- `learning_rate_mapping`: {} |
|
|
|
|
|
</details> |
|
|
|
|
|
### Training Logs |
|
|
| Epoch | Step | Training Loss | Validation Loss | dev_cosine_accuracy | |
|
|
|:------:|:----:|:-------------:|:---------------:|:-------------------:| |
|
|
| -1 | -1 | - | - | 0.5848 | |
|
|
| 0.3584 | 100 | - | 0.0570 | 0.9030 | |
|
|
| 0.7168 | 200 | 0.0638 | 0.0504 | 0.9008 | |
|
|
| 1.0753 | 300 | - | 0.0431 | 0.9331 | |
|
|
| 1.4337 | 400 | 0.0067 | 0.0385 | 0.9292 | |
|
|
| 1.7921 | 500 | - | 0.0715 | 0.9191 | |
|
|
| 2.1505 | 600 | 0.0045 | 0.0664 | 0.9309 | |
|
|
| 2.5090 | 700 | - | 0.0620 | 0.9414 | |
|
|
| 2.8674 | 800 | 0.0029 | 0.0532 | 0.9467 | |
|
|
| 3.2258 | 900 | - | 0.0586 | 0.9432 | |
|
|
| 3.5842 | 1000 | 0.0041 | 0.0431 | 0.9432 | |
|
|
| 3.9427 | 1100 | - | 0.0464 | 0.9432 | |
|
|
| 4.3011 | 1200 | 0.0022 | 0.0611 | 0.9406 | |
|
|
| 4.6595 | 1300 | - | 0.0646 | 0.9423 | |
|
|
|
|
|
|
|
|
### Framework Versions |
|
|
- Python: 3.11.10 |
|
|
- Sentence Transformers: 5.0.0 |
|
|
- Transformers: 4.54.0 |
|
|
- PyTorch: 2.5.1+cu124 |
|
|
- Accelerate: 1.9.0 |
|
|
- Datasets: 4.0.0 |
|
|
- Tokenizers: 0.21.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{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.* |
|
|
--> |