Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Paper
•
1908.10084
•
Published
•
9
This is a sentence-transformers model finetuned from Snowflake/snowflake-arctic-embed-m-v2.0. 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.
SentenceTransformer(
(0): Transformer({'max_seq_length': 8192, 'do_lower_case': False, 'architecture': 'GteModel'})
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, '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': False, 'include_prompt': True})
(2): Normalize()
)
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("BjarneNPO-30_08_2025_14_21_12")
# Run inference
queries = [
"Ein Vater taucht nicht auf bei den Eltern im Elternbeirat \r\n\r\nAu\u00dferdem auf die Kinder mit archivierten Angeh\u00f6rigen hingewiesen und ihr gezeigt",
]
documents = [
'Weil er keinen Zugang zur EAPP hat, Außerdem auf die Kinder mit archivierten Angehörigen hingewiesen und ihr gezeigt wie sie das lösen kann',
'1. Vorlage da. Userin auch gezeigt wie sie die verwanden kann\r\n2. Als Wunsch weitergegeben.',
'In der Kinderliste haben Kinder gefehlt. Userin muss die Daten in der Kinderliste hinterlegen.',
]
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.4885, 0.1653, -0.0624]])
Snowflake/snowflake-arctic-embed-m-v2.0scripts.InformationRetrievalEvaluatorCustom.InformationRetrievalEvaluatorCustom with these parameters:{
"query_prompt_name": "query",
"corpus_prompt_name": "query"
}
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.1159 |
| cosine_accuracy@3 | 0.6377 |
| cosine_accuracy@5 | 0.7536 |
| cosine_accuracy@10 | 0.8551 |
| cosine_precision@1 | 0.1159 |
| cosine_precision@3 | 0.3382 |
| cosine_precision@5 | 0.3362 |
| cosine_precision@10 | 0.2754 |
| cosine_recall@1 | 0.0152 |
| cosine_recall@3 | 0.0815 |
| cosine_recall@5 | 0.1271 |
| cosine_recall@10 | 0.2013 |
| cosine_ndcg@10 | 0.2935 |
| cosine_mrr@10 | 0.3933 |
| cosine_map@100 | 0.191 |
query and answer| query | answer | |
|---|---|---|
| type | string | string |
| details |
|
|
| query | answer |
|---|---|
Nun ist die Monatsmeldung erfolgt, aber rote Ausrufezeichen tauchen auf. |
Userin an das JA verwiesen, diese müssten ihr die Schloss-Monate zur Überarbeitung im Kibiz.web zurückgeben. Userin dazu empfohlen, die Kinder die nicht in kitaplus sind, aber in Kibiz.web - im KiBiz.web zu entfernen, wenn diese nicht vorhanden sind. |
Die Feiertage in den Stammdaten stimmen nicht. |
Es besteht bereits ein Ticket dafür. |
Abrechnung kann nicht final freigegeben werden, es wird aber keiner Fehlermeldung angeziegt |
im Hintergrund ist eine Fehlermeldung zu sehen. An Entwickler weitergeleitet. |
Korrektur vorgenommen. |
MultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim",
"gather_across_devices": false
}
eval_strategy: epochper_device_train_batch_size: 32per_device_eval_batch_size: 32gradient_accumulation_steps: 4learning_rate: 4e-05weight_decay: 0.01lr_scheduler_type: cosinewarmup_ratio: 0.08bf16: Truetf32: Trueload_best_model_at_end: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: epochprediction_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: 4eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 4e-05weight_decay: 0.01adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 3max_steps: -1lr_scheduler_type: cosinelr_scheduler_kwargs: {}warmup_ratio: 0.08warmup_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: Falseuse_ipex: Falsebf16: Truefp16: Falsefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Truelocal_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}deepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_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: Falseneftune_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: Falseprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | Snowflake/snowflake-arctic-embed-m-v2.0_cosine_ndcg@10 |
|---|---|---|---|
| 0.0177 | 10 | 2.222 | - |
| 0.0354 | 20 | 2.1654 | - |
| 0.0531 | 30 | 1.9612 | - |
| 0.0708 | 40 | 1.9062 | - |
| 0.0885 | 50 | 1.7656 | - |
| 0.1061 | 60 | 1.6486 | - |
| 0.1238 | 70 | 1.7007 | - |
| 0.1415 | 80 | 1.5751 | - |
| 0.1592 | 90 | 1.4276 | - |
| 0.1769 | 100 | 1.3517 | - |
| 0.1946 | 110 | 1.3504 | - |
| 0.2123 | 120 | 1.2746 | - |
| 0.2300 | 130 | 1.1651 | - |
| 0.2477 | 140 | 1.1792 | - |
| 0.2654 | 150 | 1.179 | - |
| 0.2831 | 160 | 1.1116 | - |
| 0.3008 | 170 | 1.0424 | - |
| 0.3184 | 180 | 1.1106 | - |
| 0.3361 | 190 | 1.0714 | - |
| 0.3538 | 200 | 1.0182 | - |
| 0.3715 | 210 | 1.081 | - |
| 0.3892 | 220 | 0.9924 | - |
| 0.4069 | 230 | 0.9754 | - |
| 0.4246 | 240 | 0.9466 | - |
| 0.4423 | 250 | 0.8339 | - |
| 0.4600 | 260 | 0.9173 | - |
| 0.4777 | 270 | 0.9609 | - |
| 0.4954 | 280 | 0.9203 | - |
| 0.5130 | 290 | 0.8255 | - |
| 0.5307 | 300 | 0.8579 | - |
| 0.5484 | 310 | 0.8641 | - |
| 0.5661 | 320 | 0.818 | - |
| 0.5838 | 330 | 0.8108 | - |
| 0.6015 | 340 | 0.8181 | - |
| 0.6192 | 350 | 0.8085 | - |
| 0.6369 | 360 | 0.7518 | - |
| 0.6546 | 370 | 0.7966 | - |
| 0.6723 | 380 | 0.7931 | - |
| 0.6900 | 390 | 0.7805 | - |
| 0.7077 | 400 | 0.7886 | - |
| 0.7253 | 410 | 0.7533 | - |
| 0.7430 | 420 | 0.7856 | - |
| 0.7607 | 430 | 0.7638 | - |
| 0.7784 | 440 | 0.8108 | - |
| 0.7961 | 450 | 0.7351 | - |
| 0.8138 | 460 | 0.7872 | - |
| 0.8315 | 470 | 0.7638 | - |
| 0.8492 | 480 | 0.7282 | - |
| 0.8669 | 490 | 0.744 | - |
| 0.8846 | 500 | 0.7623 | - |
| 0.9023 | 510 | 0.6875 | - |
| 0.9199 | 520 | 0.6862 | - |
| 0.9376 | 530 | 0.6796 | - |
| 0.9553 | 540 | 0.7507 | - |
| 0.9730 | 550 | 0.7265 | - |
| 0.9907 | 560 | 0.6127 | - |
| 1.0 | 566 | - | 0.2936 |
| 1.0071 | 570 | 0.6119 | - |
| 1.0248 | 580 | 0.5961 | - |
| 1.0425 | 590 | 0.5999 | - |
| 1.0602 | 600 | 0.5878 | - |
| 1.0778 | 610 | 0.591 | - |
| 1.0955 | 620 | 0.5794 | - |
| 1.1132 | 630 | 0.5437 | - |
| 1.1309 | 640 | 0.5597 | - |
| 1.1486 | 650 | 0.5532 | - |
| 1.1663 | 660 | 0.557 | - |
| 1.1840 | 670 | 0.5519 | - |
| 1.2017 | 680 | 0.5435 | - |
| 1.2194 | 690 | 0.5211 | - |
| 1.2371 | 700 | 0.5292 | - |
| 1.2548 | 710 | 0.5356 | - |
| 1.2724 | 720 | 0.566 | - |
| 1.2901 | 730 | 0.5883 | - |
| 1.3078 | 740 | 0.5436 | - |
| 1.3255 | 750 | 0.5858 | - |
| 1.3432 | 760 | 0.5718 | - |
| 1.3609 | 770 | 0.5275 | - |
| 1.3786 | 780 | 0.5561 | - |
| 1.3963 | 790 | 0.5388 | - |
| 1.4140 | 800 | 0.5104 | - |
| 1.4317 | 810 | 0.484 | - |
| 1.4494 | 820 | 0.5569 | - |
| 1.4670 | 830 | 0.5432 | - |
| 1.4847 | 840 | 0.5155 | - |
| 1.5024 | 850 | 0.5242 | - |
| 1.5201 | 860 | 0.5279 | - |
| 1.5378 | 870 | 0.5044 | - |
| 1.5555 | 880 | 0.559 | - |
| 1.5732 | 890 | 0.4286 | - |
| 1.5909 | 900 | 0.5065 | - |
| 1.6086 | 910 | 0.558 | - |
| 1.6263 | 920 | 0.5605 | - |
| 1.6440 | 930 | 0.4814 | - |
| 1.6617 | 940 | 0.5805 | - |
| 1.6793 | 950 | 0.5592 | - |
| 1.6970 | 960 | 0.5019 | - |
| 1.7147 | 970 | 0.5518 | - |
| 1.7324 | 980 | 0.499 | - |
| 1.7501 | 990 | 0.491 | - |
| 1.7678 | 1000 | 0.4927 | - |
| 1.7855 | 1010 | 0.478 | - |
| 1.8032 | 1020 | 0.5122 | - |
| 1.8209 | 1030 | 0.5283 | - |
| 1.8386 | 1040 | 0.4683 | - |
| 1.8563 | 1050 | 0.4743 | - |
| 1.8739 | 1060 | 0.4952 | - |
| 1.8916 | 1070 | 0.4601 | - |
| 1.9093 | 1080 | 0.4666 | - |
| 1.9270 | 1090 | 0.4645 | - |
| 1.9447 | 1100 | 0.4914 | - |
| 1.9624 | 1110 | 0.5115 | - |
| 1.9801 | 1120 | 0.5176 | - |
| 1.9978 | 1130 | 0.4656 | - |
| 2.0 | 1132 | - | 0.2927 |
| 2.0142 | 1140 | 0.4081 | - |
| 2.0318 | 1150 | 0.383 | - |
| 2.0495 | 1160 | 0.4114 | - |
| 2.0672 | 1170 | 0.3946 | - |
| 2.0849 | 1180 | 0.4084 | - |
| 2.1026 | 1190 | 0.4244 | - |
| 2.1203 | 1200 | 0.4024 | - |
| 2.1380 | 1210 | 0.3701 | - |
| 2.1557 | 1220 | 0.422 | - |
| 2.1734 | 1230 | 0.3798 | - |
| 2.1911 | 1240 | 0.385 | - |
| 2.2088 | 1250 | 0.3812 | - |
| 2.2264 | 1260 | 0.3572 | - |
| 2.2441 | 1270 | 0.4088 | - |
| 2.2618 | 1280 | 0.418 | - |
| 2.2795 | 1290 | 0.4131 | - |
| 2.2972 | 1300 | 0.3434 | - |
| 2.3149 | 1310 | 0.3803 | - |
| 2.3326 | 1320 | 0.364 | - |
| 2.3503 | 1330 | 0.3909 | - |
| 2.3680 | 1340 | 0.4196 | - |
| 2.3857 | 1350 | 0.3752 | - |
| 2.4034 | 1360 | 0.3698 | - |
| 2.4211 | 1370 | 0.3837 | - |
| 2.4387 | 1380 | 0.3496 | - |
| 2.4564 | 1390 | 0.3746 | - |
| 2.4741 | 1400 | 0.3437 | - |
| 2.4918 | 1410 | 0.3847 | - |
| 2.5095 | 1420 | 0.3748 | - |
| 2.5272 | 1430 | 0.4076 | - |
| 2.5449 | 1440 | 0.3844 | - |
| 2.5626 | 1450 | 0.3901 | - |
| 2.5803 | 1460 | 0.3911 | - |
| 2.5980 | 1470 | 0.3351 | - |
| 2.6157 | 1480 | 0.4038 | - |
| 2.6333 | 1490 | 0.3784 | - |
| 2.6510 | 1500 | 0.382 | - |
| 2.6687 | 1510 | 0.3983 | - |
| 2.6864 | 1520 | 0.3514 | - |
| 2.7041 | 1530 | 0.426 | - |
| 2.7218 | 1540 | 0.3522 | - |
| 2.7395 | 1550 | 0.3749 | - |
| 2.7572 | 1560 | 0.3864 | - |
| 2.7749 | 1570 | 0.372 | - |
| 2.7926 | 1580 | 0.3264 | - |
| 2.8103 | 1590 | 0.3687 | - |
| 2.8280 | 1600 | 0.3936 | - |
| 2.8456 | 1610 | 0.3468 | - |
| 2.8633 | 1620 | 0.4002 | - |
| 2.8810 | 1630 | 0.4133 | - |
| 2.8987 | 1640 | 0.395 | - |
| 2.9164 | 1650 | 0.4018 | - |
| 2.9341 | 1660 | 0.4118 | - |
| 2.9518 | 1670 | 0.3795 | - |
| 2.9695 | 1680 | 0.3843 | - |
| 2.9872 | 1690 | 0.4375 | - |
| 3.0 | 1698 | - | 0.2935 |
@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",
}
@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}
}
Base model
Snowflake/snowflake-arctic-embed-m-v2.0