Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 2048, 'do_lower_case': False, 'architecture': 'Gemma3TextModel'})
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
(2): Dense({'in_features': 768, 'out_features': 3072, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity'})
(3): Dense({'in_features': 3072, 'out_features': 768, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity'})
(4): Normalize()
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("Maksim-KOS/embeddinggemma-300m-saturn-planet-v2")
5# Run inference
6queries = [
7 "\u0428\u043a\u0443\u0440\u043a\u0430 \u0432\u043e\u0434\u043e\u0441\u0442\u043e\u0439\u043a\u0430\u044f \u043d\u0430 \u0442\u043a\u0430\u043d\u0435\u0432\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u0435 P80 80\u043c\u043c \u0440\u0443\u043b\u043e\u043d 20\u043c",
8]
9documents = [
10 'Шкурка шлифовальная водостойкая на тканевой основе 805 мм, 20Н (P80), рулон 20 м',
11 'Шкурка шлифовальная водостойкая на тканевой основе 805 мм 25Н (P60) 1 п.м.',
12 'Перчатки КЩС тип 2 тонкие',
13]
14query_embeddings = model.encode_query(queries)
15document_embeddings = model.encode_document(documents)
16print(query_embeddings.shape, document_embeddings.shape)
17# [1, 768] [3, 768]
18
19# Get the similarity scores for the embeddings
20similarities = model.similarity(query_embeddings, document_embeddings)
21print(similarities)
22# tensor([[ 0.8399, 0.2156, -0.0400]])hard-neg-evalTripletEvaluator| Metric | Value |
|---|---|
| cosine_accuracy | 0.9931 |
anchor, positive, and negative| anchor | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor | positive | negative |
|---|---|---|
Кабель Камкабель КГтп 2х2,5 220 В (100 м), шт | Кабель КГтп-ХЛ 2х2,5мм2, гибкий, черный (бухта-100п.м.) | Кабель КГтп-ХЛ 2х1,5мм2 TDM гибкий, черный (бухта-100п.м.) |
Клей для плитки Основит Стройбриг С0T АС12 25 кг | Клей для плитки Стройбриг Гранификс АС12 усиленный (25 кг) | Клей для плитки Основит Мастпликс AC121 Т выравнивающий (25 кг) |
линолеум juteks аванта 4м | Линолеум бытовой Juteks Avanta NXT Kortes 4 (4 м) | Линолеум бытовой Juteks Avanta Fort 5 (4 м) |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "gather_across_devices": false
5}anchor, positive, and negative| anchor | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor | positive | negative |
|---|---|---|
Свая винтовая d76х2000 мм, шт | Свая винтовая d=76 мм, L=2000 мм, d винтовой части = 220 мм | Столб заборный винт., L=3000 мм (60х60 мм L=2000 мм, d=51 мм L=1000 мм) |
Нивелир лазерный Condtrol Neo Х200 (1-2-115) с магнитной шайбой, шт | Лазерный нивелир Condtrol NEO X200 | Нивелир лазерный Condtrol NEO X2-360 |
керамогранит светло-коричневый 594х147 мм | Керамогранит Березакерамика Шеми GP, светло-коричневый, 594х147х9 мм | Керамогранит Керамин Портланд 3, мат., светло-бежевый, 600х600х10 мм |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "gather_across_devices": false
5}eval_strategy: stepsper_device_train_batch_size: 32per_device_eval_batch_size: 32gradient_accumulation_steps: 8learning_rate: 1e-05weight_decay: 0.01num_train_epochs: 10lr_scheduler_type: cosinewarmup_ratio: 0.1load_best_model_at_end: Trueoptim: adamw_torchbatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 32per_device_eval_batch_size: 32per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 8eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 1e-05weight_decay: 0.01adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 10max_steps: -1lr_scheduler_type: cosinelr_scheduler_kwargs: Nonewarmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falsebf16: Falsefp16: Falsefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torchoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters:auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: noneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Trueprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | Validation Loss | hard-neg-eval_cosine_accuracy |
|---|---|---|---|---|
| 0.1030 | 50 | 0.2049 | - | - |
| 0.2060 | 100 | 0.0909 | 0.0862 | 0.9690 |
| 0.3090 | 150 | 0.0768 | - | - |
| 0.4121 | 200 | 0.0652 | 0.0626 | 0.9769 |
| 0.5151 | 250 | 0.0597 | - | - |
| 0.6181 | 300 | 0.0592 | 0.0564 | 0.9793 |
| 0.7211 | 350 | 0.0572 | - | - |
| 0.8241 | 400 | 0.0484 | 0.0497 | 0.9814 |
| 0.9271 | 450 | 0.0492 | - | - |
| 1.0288 | 500 | 0.0444 | 0.0503 | 0.9811 |
| 1.1319 | 550 | 0.039 | - | - |
| 1.2349 | 600 | 0.0399 | 0.0448 | 0.9830 |
| 1.3379 | 650 | 0.0397 | - | - |
| 1.4409 | 700 | 0.0351 | 0.0405 | 0.9851 |
| 1.5439 | 750 | 0.0368 | - | - |
| 1.6469 | 800 | 0.0389 | 0.0375 | 0.9851 |
| 1.7499 | 850 | 0.0353 | - | - |
| 1.8529 | 900 | 0.0366 | 0.0354 | 0.9859 |
| 1.9560 | 950 | 0.0314 | - | - |
| 2.0577 | 1000 | 0.0264 | 0.0345 | 0.9865 |
| 2.1607 | 1050 | 0.0234 | - | - |
| 2.2637 | 1100 | 0.0245 | 0.0343 | 0.9869 |
| 2.3667 | 1150 | 0.0229 | - | - |
| 2.4697 | 1200 | 0.0235 | 0.0335 | 0.9875 |
| 2.5728 | 1250 | 0.0226 | - | - |
| 2.6758 | 1300 | 0.0249 | 0.0293 | 0.9888 |
| 2.7788 | 1350 | 0.0224 | - | - |
| 2.8818 | 1400 | 0.023 | 0.0278 | 0.9904 |
| 2.9848 | 1450 | 0.0233 | - | - |
| 3.0865 | 1500 | 0.0156 | 0.0275 | 0.9896 |
| 3.1895 | 1550 | 0.0145 | - | - |
| 3.2926 | 1600 | 0.0142 | 0.0269 | 0.9896 |
| 3.3956 | 1650 | 0.015 | - | - |
| 3.4986 | 1700 | 0.017 | 0.0258 | 0.9897 |
| 3.6016 | 1750 | 0.0152 | - | - |
| 3.7046 | 1800 | 0.0148 | 0.0246 | 0.9905 |
| 3.8076 | 1850 | 0.0149 | - | - |
| 3.9106 | 1900 | 0.0166 | 0.0251 | 0.9902 |
| 4.0124 | 1950 | 0.0173 | - | - |
| 4.1154 | 2000 | 0.0102 | 0.0238 | 0.9907 |
| 4.2184 | 2050 | 0.0092 | - | - |
| 4.3214 | 2100 | 0.0113 | 0.0221 | 0.9920 |
| 4.4244 | 2150 | 0.0082 | - | - |
| 4.5274 | 2200 | 0.0091 | 0.0221 | 0.9921 |
| 4.6304 | 2250 | 0.0107 | - | - |
| 4.7335 | 2300 | 0.0111 | 0.0208 | 0.9928 |
| 4.8365 | 2350 | 0.0086 | - | - |
| 4.9395 | 2400 | 0.0103 | 0.0202 | 0.9921 |
| 5.0412 | 2450 | 0.0076 | - | - |
| 5.1442 | 2500 | 0.0066 | 0.0193 | 0.9933 |
| 5.2472 | 2550 | 0.0068 | - | - |
| 5.3502 | 2600 | 0.006 | 0.0198 | 0.9932 |
| 5.4533 | 2650 | 0.0064 | - | - |
| 5.5563 | 2700 | 0.0057 | 0.0190 | 0.9931 |
| 5.6593 | 2750 | 0.0057 | - | - |
| 5.7623 | 2800 | 0.0061 | 0.0184 | 0.9931 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{henderson2017efficient,
2 title={Efficient Natural Language Response Suggestion for Smart Reply},
3 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},
4 year={2017},
5 eprint={1705.00652},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}