metadata
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:123502
- loss:MultipleNegativesRankingLoss
base_model: google/embeddinggemma-300m
widget:
- source_sentence: стержни клеевые 11 x 200 mm прозрачные
sentences:
- шпаклевка danogips superfinish готовая 18 кг
- стержни для клеевого пистолета biber 60131 прозр. 11 x 200 mm 6 шт.
- наличник деревянный прямой сращенный сорт экстра 11 x 90 x 2200 mm
- source_sentence: стамеска 18 mm biber мастер
sentences:
- стамеска biber 85057 мастер 18 mm
- стамеска biber 85053 мастер 10 mm
- наконечник ншви 2 6 0 14 для провода 6 mm2 100 шт.
- source_sentence: саморез 3.8 x 41 mm шсгд
sentences:
- коробка упаковочная сатурн 550 x 380 x 300 mm картон
- саморез swfs шсгд 3.8 x 51 200 шт
- саморез swfs шсгд zy 3.8 x 41 25 шт пакетик
- source_sentence: гибкое стекло 140 x 80 см
sentences:
- гибкое стекло dekorelle 140 x 80 см
- стекломагнезитовый лист стандарт 2500 x 1220 x 8 mm
- труба valfex полипропилен арmир. стекл. d 40 x 5.5 mm pn 20 4 m
- source_sentence: трап горизонтальный 100 x 100 mm d50 mm с гидрозатвором
sentences:
- >-
лоток водоотводный standartpark basic dn100 1000 x 156 x 120 mm пластик
8020 m
- >-
трап ани пласт горизонтальный d 50 mm 100 x 100 mm не регулируемый
гидрозатвор
- саморез шуж swfs pn 4 x 12 1000 шт
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- cosine_accuracy
model-index:
- name: SentenceTransformer based on google/embeddinggemma-300m
results:
- task:
type: triplet
name: Triplet
dataset:
name: hard neg eval
type: hard-neg-eval
metrics:
- type: cosine_accuracy
value: 0.9975224137306213
name: Cosine Accuracy
SentenceTransformer based on google/embeddinggemma-300m
This is a sentence-transformers model finetuned from google/embeddinggemma-300m. It maps sentences & paragraphs to a 768-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: google/embeddinggemma-300m
- Maximum Sequence Length: 2048 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
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()
)
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("Maksim-KOS/embeddinggemma-300m-saturn-planet")
# Run inference
queries = [
"\u0442\u0440\u0430\u043f \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 100 x 100 mm d50 mm \u0441 \u0433\u0438\u0434\u0440\u043e\u0437\u0430\u0442\u0432\u043e\u0440\u043e\u043c",
]
documents = [
'трап ани пласт горизонтальный d 50 mm 100 x 100 mm не регулируемый гидрозатвор',
'лоток водоотводный standartpark basic dn100 1000 x 156 x 120 mm пластик 8020 m',
'саморез шуж swfs pn 4 x 12 1000 шт',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 768] [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[ 0.7530, 0.1274, -0.0019]])
Evaluation
Metrics
Triplet
- Dataset:
hard-neg-eval - Evaluated with
TripletEvaluator
| Metric | Value |
|---|---|
| cosine_accuracy | 0.9975 |
Training Details
Training Dataset
Unnamed Dataset
- Size: 123,502 training samples
- Columns:
anchor,positive, andnegative - Approximate statistics based on the first 1000 samples:
anchor positive negative type string string string details - min: 6 tokens
- mean: 21.44 tokens
- max: 56 tokens
- min: 7 tokens
- mean: 25.22 tokens
- max: 48 tokens
- min: 9 tokens
- mean: 26.08 tokens
- max: 50 tokens
- Samples:
anchor positive negative ремонтный состав быстротвердеющий gerkules 5 кгремонтный состав gerkules gs 22 быстротвердеющий 5 кгклей для плитки и керамогранита gerkules granit pro gm 245 25 кгтяга подвеса 350 mmтяга подвеса 350 mmподвес прямой 200 mm knauf 72519подложка вспененный полиэтилен 4 mmподложка из вспененного полиэтилена 4 mm 1 п.m.подложка из вспененного полиэтилена 5 mm 50 m 2 - Loss:
MultipleNegativesRankingLosswith these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim", "gather_across_devices": false }
Evaluation Dataset
Unnamed Dataset
- Size: 13,723 evaluation samples
- Columns:
anchor,positive, andnegative - Approximate statistics based on the first 1000 samples:
anchor positive negative type string string string details - min: 6 tokens
- mean: 21.29 tokens
- max: 57 tokens
- min: 7 tokens
- mean: 25.17 tokens
- max: 50 tokens
- min: 7 tokens
- mean: 26.08 tokens
- max: 50 tokens
- Samples:
anchor positive negative краска для стен и потолков морозостойкая 6.5 кгкраска для стен и потолков pufas decoself морозостойкая 6.5 кгкраска моющаяся pufas decoself морозостойкая нв 23.1 кгрозетка компьютерная rj45 1 гнездо скрытаярозетка компьютерная rj 45 с у atlasdesign atn001083 1 гнездо карбонрозетка компьютерная rj 45 с у atlasdesign atn001085 2 гнезда карбонсаморез кровельный 4.8 x 28 коричневый оцинкованныйсаморез кровельный swfs premium ral 8017 zp 4.8 x 28 300 шт круглый конт рсаморез кровельный swfs premium ral 5002 zp 4.8 x 28 250 шт - Loss:
MultipleNegativesRankingLosswith these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim", "gather_across_devices": false }
Training Hyperparameters
Non-Default Hyperparameters
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_duplicates
All Hyperparameters
Click to expand
overwrite_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: {}
Training Logs
| Epoch | Step | Training Loss | Validation Loss | hard-neg-eval_cosine_accuracy |
|---|---|---|---|---|
| 0.1036 | 50 | 0.1448 | - | - |
| 0.2073 | 100 | 0.0509 | 0.0448 | 0.9884 |
| 0.3109 | 150 | 0.0373 | - | - |
| 0.4145 | 200 | 0.0285 | 0.0288 | 0.9923 |
| 0.5181 | 250 | 0.0291 | - | - |
| 0.6218 | 300 | 0.0264 | 0.0228 | 0.9944 |
| 0.7254 | 350 | 0.0252 | - | - |
| 0.8290 | 400 | 0.0236 | 0.0212 | 0.9953 |
| 0.9326 | 450 | 0.0258 | - | - |
| 1.0352 | 500 | 0.0217 | 0.0201 | 0.9956 |
| 1.1389 | 550 | 0.02 | - | - |
| 1.2425 | 600 | 0.0161 | 0.0182 | 0.9953 |
| 1.3461 | 650 | 0.0189 | - | - |
| 1.4497 | 700 | 0.0162 | 0.0164 | 0.9959 |
| 1.5534 | 750 | 0.0174 | - | - |
| 1.6570 | 800 | 0.0173 | 0.0160 | 0.9956 |
| 1.7606 | 850 | 0.0168 | - | - |
| 1.8642 | 900 | 0.015 | 0.0138 | 0.9972 |
| 1.9679 | 950 | 0.0132 | - | - |
| 2.0705 | 1000 | 0.0117 | 0.0129 | 0.9967 |
| 2.1741 | 1050 | 0.0111 | - | - |
| 2.2777 | 1100 | 0.0092 | 0.0120 | 0.9970 |
| 2.3813 | 1150 | 0.0117 | - | - |
| 2.485 | 1200 | 0.0101 | 0.0113 | 0.9972 |
| 2.5886 | 1250 | 0.0112 | - | - |
| 2.6922 | 1300 | 0.0098 | 0.0116 | 0.9972 |
| 2.7959 | 1350 | 0.0121 | - | - |
| 2.8995 | 1400 | 0.0095 | 0.0114 | 0.9975 |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.12.3
- Sentence Transformers: 5.2.0
- Transformers: 4.57.6
- PyTorch: 2.9.1+cu128
- Accelerate: 1.12.0
- Datasets: 4.5.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{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}
}