Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 128, 'do_lower_case': False, 'architecture': 'BertModel'})
(1): Pooling({'word_embedding_dimension': 384, '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})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("sentence_transformers_model_id")
5# Run inference
6sentences = [
7 '我只想暖和一下。',
8 'mi wile kama seli taso.',
9 'tomo tawa sina li lon ni.',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 384]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities)
18# tensor([[1.0000, 0.7361, 0.2725],
19# [0.7361, 1.0000, 0.2417],
20# [0.2725, 0.2417, 1.0000]])eval_dataMSEEvaluator| Metric | Value |
|---|---|
| negative_mse | -1.9607 |
eval_dataTranslationEvaluator| Metric | Value |
|---|---|
| src2trg_accuracy | 0.6918 |
| trg2src_accuracy | 0.6346 |
| mean_accuracy | 0.6632 |
natural, tok, and label| natural | tok | label | |
|---|---|---|---|
| type | string | string | list |
| details |
|
|
|
| natural | tok | label |
|---|---|---|
Я держу руку. | mi sewi e luka mi. | [-0.17412713170051575, 0.2601699233055115, 0.3189601004123688, 0.009355960413813591, -0.030796436592936516, ...] |
Я змарыўся ад працы. | tan pali mi la mi pilin lape. | [0.1258312165737152, 0.173202782869339, 0.16050441563129425, 0.2519824206829071, -0.035661786794662476, ...] |
Mi bolso necesita ser reparado. | poki mi li pakala. | [-0.22065182030200958, 0.3290186822414398, -0.006242208182811737, 0.18535998463630676, 0.3087056577205658, ...] |
MSELossnatural, tok, and label| natural | tok | label | |
|---|---|---|---|
| type | string | string | list |
| details |
|
|
|
| natural | tok | label |
|---|---|---|
Da quanto tempo sei/state in Germania? | tenpo pi suli seme la sina lon ma Tosi? | [0.43582403659820557, 0.4226286709308624, 0.06436676532030106, -0.38238099217414856, -0.13951840996742249, ...] |
Habesne difficultatem hac re? | ni li ike tawa sina anu seme? | [0.22038640081882477, 0.03845325857400894, 0.20817194879055023, 0.08335897326469421, -0.10346948355436325, ...] |
אני לא הולך להפסיד. | mi kama ala anpa. | [0.3058338761329651, 0.06292764097452164, 0.019105680286884308, -0.04162227734923363, -0.10258055478334427, ...] |
MSELosseval_strategy: stepsper_device_train_batch_size: 64per_device_eval_batch_size: 64learning_rate: 2e-05num_train_epochs: 12warmup_ratio: 0.1fp16: Trueload_best_model_at_end: Trueoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 64per_device_eval_batch_size: 64per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 12max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_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: Falseuse_ipex: Falsebf16: Falsefp16: Truefp16_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}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: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | Validation Loss | eval_data_negative_mse | eval_data_mean_accuracy |
|---|---|---|---|---|---|
| 0.0779 | 100 | 0.0257 | - | - | - |
| 0.1559 | 200 | 0.0235 | - | - | - |
| 0.2338 | 300 | 0.0221 | - | - | - |
| 0.3118 | 400 | 0.0217 | - | - | - |
| 0.3897 | 500 | 0.0209 | - | - | - |
| 0.4677 | 600 | 0.0201 | - | - | - |
| 0.5456 | 700 | 0.0192 | - | - | - |
| 0.6235 | 800 | 0.0186 | - | - | - |
| 0.7015 | 900 | 0.0176 | - | - | - |
| 0.7794 | 1000 | 0.0171 | - | - | - |
| 0.8574 | 1100 | 0.0166 | - | - | - |
| 0.9353 | 1200 | 0.0159 | - | - | - |
| 1.0133 | 1300 | 0.0154 | - | - | - |
| 1.0912 | 1400 | 0.015 | - | - | - |
| 1.1691 | 1500 | 0.0145 | - | - | - |
| 1.2471 | 1600 | 0.0143 | - | - | - |
| 1.3250 | 1700 | 0.014 | - | - | - |
| 1.4030 | 1800 | 0.0139 | - | - | - |
| 1.4809 | 1900 | 0.0136 | - | - | - |
| 1.5588 | 2000 | 0.0134 | 0.0122 | -2.3609 | 0.5603 |
| 1.6368 | 2100 | 0.0133 | - | - | - |
| 1.7147 | 2200 | 0.0133 | - | - | - |
| 1.7927 | 2300 | 0.0132 | - | - | - |
| 1.8706 | 2400 | 0.0131 | - | - | - |
| 1.9486 | 2500 | 0.0131 | - | - | - |
| 2.0265 | 2600 | 0.0129 | - | - | - |
| 2.1044 | 2700 | 0.0127 | - | - | - |
| 2.1824 | 2800 | 0.0125 | - | - | - |
| 2.2603 | 2900 | 0.0125 | - | - | - |
| 2.3383 | 3000 | 0.0124 | - | - | - |
| 2.4162 | 3100 | 0.0123 | - | - | - |
| 2.4942 | 3200 | 0.0122 | - | - | - |
| 2.5721 | 3300 | 0.0121 | - | - | - |
| 2.6500 | 3400 | 0.0123 | - | - | - |
| 2.7280 | 3500 | 0.0122 | - | - | - |
| 2.8059 | 3600 | 0.0122 | - | - | - |
| 2.8839 | 3700 | 0.0121 | - | - | - |
| 2.9618 | 3800 | 0.0122 | - | - | - |
| 3.0398 | 3900 | 0.012 | - | - | - |
| 3.1177 | 4000 | 0.0119 | 0.0110 | -2.1275 | 0.6289 |
| 3.1956 | 4100 | 0.0118 | - | - | - |
| 3.2736 | 4200 | 0.0118 | - | - | - |
| 3.3515 | 4300 | 0.0117 | - | - | - |
| 3.4295 | 4400 | 0.0117 | - | - | - |
| 3.5074 | 4500 | 0.0116 | - | - | - |
| 3.5853 | 4600 | 0.0116 | - | - | - |
| 3.6633 | 4700 | 0.0117 | - | - | - |
| 3.7412 | 4800 | 0.0117 | - | - | - |
| 3.8192 | 4900 | 0.0116 | - | - | - |
| 3.8971 | 5000 | 0.0117 | - | - | - |
| 3.9751 | 5100 | 0.0115 | - | - | - |
| 4.0530 | 5200 | 0.0115 | - | - | - |
| 4.1309 | 5300 | 0.0113 | - | - | - |
| 4.2089 | 5400 | 0.0113 | - | - | - |
| 4.2868 | 5500 | 0.0114 | - | - | - |
| 4.3648 | 5600 | 0.0114 | - | - | - |
| 4.4427 | 5700 | 0.0113 | - | - | - |
| 4.5207 | 5800 | 0.0112 | - | - | - |
| 4.5986 | 5900 | 0.0113 | - | - | - |
| 4.6765 | 6000 | 0.0113 | 0.0107 | -2.0522 | 0.6478 |
| 4.7545 | 6100 | 0.0112 | - | - | - |
| 4.8324 | 6200 | 0.0112 | - | - | - |
| 4.9104 | 6300 | 0.0113 | - | - | - |
| 4.9883 | 6400 | 0.0113 | - | - | - |
| 5.0663 | 6500 | 0.011 | - | - | - |
| 5.1442 | 6600 | 0.011 | - | - | - |
| 5.2221 | 6700 | 0.011 | - | - | - |
| 5.3001 | 6800 | 0.0109 | - | - | - |
| 5.3780 | 6900 | 0.0111 | - | - | - |
| 5.4560 | 7000 | 0.0111 | - | - | - |
| 5.5339 | 7100 | 0.011 | - | - | - |
| 5.6118 | 7200 | 0.0109 | - | - | - |
| 5.6898 | 7300 | 0.011 | - | - | - |
| 5.7677 | 7400 | 0.011 | - | - | - |
| 5.8457 | 7500 | 0.0111 | - | - | - |
| 5.9236 | 7600 | 0.011 | - | - | - |
| 6.0016 | 7700 | 0.0112 | - | - | - |
| 6.0795 | 7800 | 0.0108 | - | - | - |
| 6.1574 | 7900 | 0.0108 | - | - | - |
| 6.2354 | 8000 | 0.0107 | 0.0105 | -2.0098 | 0.6524 |
| 6.3133 | 8100 | 0.0108 | - | - | - |
| 6.3913 | 8200 | 0.0108 | - | - | - |
| 6.4692 | 8300 | 0.0108 | - | - | - |
| 6.5472 | 8400 | 0.0109 | - | - | - |
| 6.6251 | 8500 | 0.0108 | - | - | - |
| 6.7030 | 8600 | 0.0108 | - | - | - |
| 6.7810 | 8700 | 0.0108 | - | - | - |
| 6.8589 | 8800 | 0.0107 | - | - | - |
| 6.9369 | 8900 | 0.0109 | - | - | - |
| 7.0148 | 9000 | 0.0108 | - | - | - |
| 7.0928 | 9100 | 0.0106 | - | - | - |
| 7.1707 | 9200 | 0.0107 | - | - | - |
| 7.2486 | 9300 | 0.0106 | - | - | - |
| 7.3266 | 9400 | 0.0105 | - | - | - |
| 7.4045 | 9500 | 0.0105 | - | - | - |
| 7.4825 | 9600 | 0.0107 | - | - | - |
| 7.5604 | 9700 | 0.0107 | - | - | - |
| 7.6383 | 9800 | 0.0108 | - | - | - |
| 7.7163 | 9900 | 0.0107 | - | - | - |
| 7.7942 | 10000 | 0.0106 | 0.0103 | -1.9857 | 0.6582 |
| 7.8722 | 10100 | 0.0106 | - | - | - |
| 7.9501 | 10200 | 0.0106 | - | - | - |
| 8.0281 | 10300 | 0.0106 | - | - | - |
| 8.1060 | 10400 | 0.0105 | - | - | - |
| 8.1839 | 10500 | 0.0103 | - | - | - |
| 8.2619 | 10600 | 0.0105 | - | - | - |
| 8.3398 | 10700 | 0.0105 | - | - | - |
| 8.4178 | 10800 | 0.0105 | - | - | - |
| 8.4957 | 10900 | 0.0105 | - | - | - |
| 8.5737 | 11000 | 0.0105 | - | - | - |
| 8.6516 | 11100 | 0.0105 | - | - | - |
| 8.7295 | 11200 | 0.0106 | - | - | - |
| 8.8075 | 11300 | 0.0104 | - | - | - |
| 8.8854 | 11400 | 0.0106 | - | - | - |
| 8.9634 | 11500 | 0.0106 | - | - | - |
| 9.0413 | 11600 | 0.0105 | - | - | - |
| 9.1193 | 11700 | 0.0103 | - | - | - |
| 9.1972 | 11800 | 0.0102 | - | - | - |
| 9.2751 | 11900 | 0.0105 | - | - | - |
| 9.3531 | 12000 | 0.0104 | 0.0103 | -1.9715 | 0.6624 |
| 9.4310 | 12100 | 0.0104 | - | - | - |
| 9.5090 | 12200 | 0.0104 | - | - | - |
| 9.5869 | 12300 | 0.0105 | - | - | - |
| 9.6648 | 12400 | 0.0104 | - | - | - |
| 9.7428 | 12500 | 0.0103 | - | - | - |
| 9.8207 | 12600 | 0.0105 | - | - | - |
| 9.8987 | 12700 | 0.0105 | - | - | - |
| 9.9766 | 12800 | 0.0104 | - | - | - |
| 10.0546 | 12900 | 0.0103 | - | - | - |
| 10.1325 | 13000 | 0.0103 | - | - | - |
| 10.2104 | 13100 | 0.0102 | - | - | - |
| 10.2884 | 13200 | 0.0103 | - | - | - |
| 10.3663 | 13300 | 0.0105 | - | - | - |
| 10.4443 | 13400 | 0.0103 | - | - | - |
| 10.5222 | 13500 | 0.0104 | - | - | - |
| 10.6002 | 13600 | 0.0104 | - | - | - |
| 10.6781 | 13700 | 0.0103 | - | - | - |
| 10.7560 | 13800 | 0.0103 | - | - | - |
| 10.8340 | 13900 | 0.0103 | - | - | - |
| 10.9119 | 14000 | 0.0103 | 0.0102 | -1.9607 | 0.6632 |
| 10.9899 | 14100 | 0.0102 | - | - | - |
| 11.0678 | 14200 | 0.0103 | - | - | - |
| 11.1458 | 14300 | 0.0103 | - | - | - |
| 11.2237 | 14400 | 0.0103 | - | - | - |
| 11.3016 | 14500 | 0.0102 | - | - | - |
| 11.3796 | 14600 | 0.0104 | - | - | - |
| 11.4575 | 14700 | 0.0103 | - | - | - |
| 11.5355 | 14800 | 0.0103 | - | - | - |
| 11.6134 | 14900 | 0.0103 | - | - | - |
| 11.6913 | 15000 | 0.0102 | - | - | - |
| 11.7693 | 15100 | 0.0102 | - | - | - |
| 11.8472 | 15200 | 0.0103 | - | - | - |
| 11.9252 | 15300 | 0.0102 | - | - | - |
| 12.0 | 15396 | - | 0.0102 | -1.9607 | 0.6632 |
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@inproceedings{reimers-2020-multilingual-sentence-bert,
2 title = "Making Monolingual Sentence Embeddings Multilingual using Knowledge Distillation",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2020",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/2004.09813",
9}