SentenceTransformer based on sentence-transformers/LaBSE
This is a sentence-transformers model finetuned from sentence-transformers/LaBSE. 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: sentence-transformers/LaBSE
- Maximum Sequence Length: 256 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': 256, 'do_lower_case': False}) with Transformer model: BertModel
(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): Dense({'in_features': 768, 'out_features': 768, 'bias': True, 'activation_function': 'torch.nn.modules.activation.Tanh'})
(3): 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("sentence_transformers_model_id")
# Run inference
sentences = [
'Генри Джастис Форд',
'Форд, Генри Джастис',
'Я вышел из ванны свеж и бодр, как будто собирался на бал.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
Training Details
Training Dataset
Unnamed Dataset
- Size: 1,000,000 training samples
- Columns:
sentence_0,sentence_1, andlabel - Approximate statistics based on the first 1000 samples:
sentence_0 sentence_1 label type string string float details - min: 3 tokens
- mean: 21.82 tokens
- max: 127 tokens
- min: 4 tokens
- mean: 21.16 tokens
- max: 136 tokens
- min: 1.0
- mean: 1.0
- max: 1.0
- Samples:
sentence_0 sentence_1 label Темех мар.Дело десятое.1.0Уругвайӑн тĕн ĕҫченĕсемРелигиозные деятели Уругвая1.0Эп аванах ас тӑватӑп, пилӗк ҫул каялла пахчана эпир лайӑх тасатнӑччӗ.А пять лет тому назад я знал, что сад был чищен.1.0 - Loss:
MultipleNegativesRankingLosswith these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: stepsper_device_train_batch_size: 12per_device_eval_batch_size: 12num_train_epochs: 1fp16: Truemulti_dataset_batch_sampler: round_robin
All Hyperparameters
Click to expand
overwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 12per_device_eval_batch_size: 12per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1num_train_epochs: 1max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.0warmup_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: Falseignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}tp_size: 0fsdp_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_torchoptim_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: Falsegradient_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: Falseeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: round_robin
Training Logs
Click to expand
| Epoch | Step | Training Loss |
|---|---|---|
| 0.0012 | 100 | - |
| 0.0024 | 200 | - |
| 0.0036 | 300 | - |
| 0.0048 | 400 | - |
| 0.0060 | 500 | 0.5331 |
| 0.0072 | 600 | - |
| 0.0084 | 700 | - |
| 0.0096 | 800 | - |
| 0.0108 | 900 | - |
| 0.0120 | 1000 | 0.3694 |
| 0.0132 | 1100 | - |
| 0.0144 | 1200 | - |
| 0.0156 | 1300 | - |
| 0.0168 | 1400 | - |
| 0.0180 | 1500 | 0.3141 |
| 0.0192 | 1600 | - |
| 0.0204 | 1700 | - |
| 0.0216 | 1800 | - |
| 0.0228 | 1900 | - |
| 0.0240 | 2000 | 0.2836 |
| 0.0252 | 2100 | - |
| 0.0264 | 2200 | - |
| 0.0276 | 2300 | - |
| 0.0288 | 2400 | - |
| 0.0300 | 2500 | 0.2823 |
| 0.0312 | 2600 | - |
| 0.0324 | 2700 | - |
| 0.0336 | 2800 | - |
| 0.0348 | 2900 | - |
| 0.0360 | 3000 | 0.265 |
| 0.0372 | 3100 | - |
| 0.0384 | 3200 | - |
| 0.0396 | 3300 | - |
| 0.0408 | 3400 | - |
| 0.0420 | 3500 | 0.2599 |
| 0.0432 | 3600 | - |
| 0.0444 | 3700 | - |
| 0.0456 | 3800 | - |
| 0.0468 | 3900 | - |
| 0.0480 | 4000 | 0.234 |
| 0.0492 | 4100 | - |
| 0.0504 | 4200 | - |
| 0.0516 | 4300 | - |
| 0.0528 | 4400 | - |
| 0.0540 | 4500 | 0.1966 |
| 0.0552 | 4600 | - |
| 0.0564 | 4700 | - |
| 0.0576 | 4800 | - |
| 0.0588 | 4900 | - |
| 0.0600 | 5000 | 0.2204 |
| 0.0612 | 5100 | - |
| 0.0624 | 5200 | - |
| 0.0636 | 5300 | - |
| 0.0648 | 5400 | - |
| 0.0660 | 5500 | 0.2272 |
| 0.0672 | 5600 | - |
| 0.0684 | 5700 | - |
| 0.0696 | 5800 | - |
| 0.0708 | 5900 | - |
| 0.0720 | 6000 | 0.2256 |
| 0.0732 | 6100 | - |
| 0.0744 | 6200 | - |
| 0.0756 | 6300 | - |
| 0.0768 | 6400 | - |
| 0.0780 | 6500 | 0.2071 |
| 0.0792 | 6600 | - |
| 0.0804 | 6700 | - |
| 0.0816 | 6800 | - |
| 0.0828 | 6900 | - |
| 0.0840 | 7000 | 0.2113 |
| 0.0852 | 7100 | - |
| 0.0864 | 7200 | - |
| 0.0876 | 7300 | - |
| 0.0888 | 7400 | - |
| 0.0900 | 7500 | 0.2222 |
| 0.0912 | 7600 | - |
| 0.0924 | 7700 | - |
| 0.0936 | 7800 | - |
| 0.0948 | 7900 | - |
| 0.0960 | 8000 | 0.2186 |
| 0.0972 | 8100 | - |
| 0.0984 | 8200 | - |
| 0.0996 | 8300 | - |
| 0.1008 | 8400 | - |
| 0.1020 | 8500 | 0.2137 |
| 0.1032 | 8600 | - |
| 0.1044 | 8700 | - |
| 0.1056 | 8800 | - |
| 0.1068 | 8900 | - |
| 0.1080 | 9000 | 0.1928 |
| 0.1092 | 9100 | - |
| 0.1104 | 9200 | - |
| 0.1116 | 9300 | - |
| 0.1128 | 9400 | - |
| 0.1140 | 9500 | 0.2117 |
| 0.1152 | 9600 | - |
| 0.1164 | 9700 | - |
| 0.1176 | 9800 | - |
| 0.1188 | 9900 | - |
| 0.1200 | 10000 | 0.1987 |
| 0.1212 | 10100 | - |
| 0.1224 | 10200 | - |
| 0.1236 | 10300 | - |
| 0.1248 | 10400 | - |
| 0.1260 | 10500 | 0.2011 |
| 0.1272 | 10600 | - |
| 0.1284 | 10700 | - |
| 0.1296 | 10800 | - |
| 0.1308 | 10900 | - |
| 0.1320 | 11000 | 0.1775 |
| 0.1332 | 11100 | - |
| 0.1344 | 11200 | - |
| 0.1356 | 11300 | - |
| 0.1368 | 11400 | - |
| 0.1380 | 11500 | 0.2048 |
| 0.1392 | 11600 | - |
| 0.1404 | 11700 | - |
| 0.1416 | 11800 | - |
| 0.1428 | 11900 | - |
| 0.1440 | 12000 | 0.2064 |
| 0.1452 | 12100 | - |
| 0.1464 | 12200 | - |
| 0.1476 | 12300 | - |
| 0.1488 | 12400 | - |
| 0.1500 | 12500 | 0.1883 |
| 0.1512 | 12600 | - |
| 0.1524 | 12700 | - |
| 0.1536 | 12800 | - |
| 0.1548 | 12900 | - |
| 0.1560 | 13000 | 0.2084 |
| 0.1572 | 13100 | - |
| 0.1584 | 13200 | - |
| 0.1596 | 13300 | - |
| 0.1608 | 13400 | - |
| 0.1620 | 13500 | 0.2077 |
| 0.1632 | 13600 | - |
| 0.1644 | 13700 | - |
| 0.1656 | 13800 | - |
| 0.1668 | 13900 | - |
| 0.1680 | 14000 | 0.1866 |
| 0.1692 | 14100 | - |
| 0.1704 | 14200 | - |
| 0.1716 | 14300 | - |
| 0.1728 | 14400 | - |
| 0.1740 | 14500 | 0.1859 |
| 0.1752 | 14600 | - |
| 0.1764 | 14700 | - |
| 0.1776 | 14800 | - |
| 0.1788 | 14900 | - |
| 0.1800 | 15000 | 0.1735 |
| 0.1812 | 15100 | - |
| 0.1824 | 15200 | - |
| 0.1836 | 15300 | - |
| 0.1848 | 15400 | - |
| 0.1860 | 15500 | 0.171 |
| 0.1872 | 15600 | - |
| 0.1884 | 15700 | - |
| 0.1896 | 15800 | - |
| 0.1908 | 15900 | - |
| 0.1920 | 16000 | 0.1465 |
| 0.1932 | 16100 | - |
| 0.1944 | 16200 | - |
| 0.1956 | 16300 | - |
| 0.1968 | 16400 | - |
| 0.1980 | 16500 | 0.1921 |
| 0.1992 | 16600 | - |
| 0.2004 | 16700 | - |
| 0.2016 | 16800 | - |
| 0.2028 | 16900 | - |
| 0.2040 | 17000 | 0.1669 |
| 0.2052 | 17100 | - |
| 0.2064 | 17200 | - |
| 0.2076 | 17300 | - |
| 0.2088 | 17400 | - |
| 0.2100 | 17500 | 0.1656 |
| 0.2112 | 17600 | - |
| 0.2124 | 17700 | - |
| 0.2136 | 17800 | - |
| 0.2148 | 17900 | - |
| 0.2160 | 18000 | 0.1952 |
| 0.2172 | 18100 | - |
| 0.2184 | 18200 | - |
| 0.2196 | 18300 | - |
| 0.2208 | 18400 | - |
| 0.2220 | 18500 | 0.1658 |
| 0.2232 | 18600 | - |
| 0.2244 | 18700 | - |
| 0.2256 | 18800 | - |
| 0.2268 | 18900 | - |
| 0.2280 | 19000 | 0.1774 |
| 0.2292 | 19100 | - |
| 0.2304 | 19200 | - |
| 0.2316 | 19300 | - |
| 0.2328 | 19400 | - |
| 0.2340 | 19500 | 0.1802 |
| 0.2352 | 19600 | - |
| 0.2364 | 19700 | - |
| 0.2376 | 19800 | - |
| 0.2388 | 19900 | - |
| 0.2400 | 20000 | 0.1724 |
| 0.2412 | 20100 | - |
| 0.2424 | 20200 | - |
| 0.2436 | 20300 | - |
| 0.2448 | 20400 | - |
| 0.2460 | 20500 | 0.1653 |
| 0.2472 | 20600 | - |
| 0.2484 | 20700 | - |
| 0.2496 | 20800 | - |
| 0.2508 | 20900 | - |
| 0.2520 | 21000 | 0.1484 |
| 0.2532 | 21100 | - |
| 0.2544 | 21200 | - |
| 0.2556 | 21300 | - |
| 0.2568 | 21400 | - |
| 0.2580 | 21500 | 0.1544 |
| 0.2592 | 21600 | - |
| 0.2604 | 21700 | - |
| 0.2616 | 21800 | - |
| 0.2628 | 21900 | - |
| 0.2640 | 22000 | 0.174 |
| 0.2652 | 22100 | - |
| 0.2664 | 22200 | - |
| 0.2676 | 22300 | - |
| 0.2688 | 22400 | - |
| 0.2700 | 22500 | 0.1488 |
| 0.2712 | 22600 | - |
| 0.2724 | 22700 | - |
| 0.2736 | 22800 | - |
| 0.2748 | 22900 | - |
| 0.2760 | 23000 | 0.1696 |
| 0.2772 | 23100 | - |
| 0.2784 | 23200 | - |
| 0.2796 | 23300 | - |
| 0.2808 | 23400 | - |
| 0.2820 | 23500 | 0.1468 |
| 0.2832 | 23600 | - |
| 0.2844 | 23700 | - |
| 0.2856 | 23800 | - |
| 0.2868 | 23900 | - |
| 0.2880 | 24000 | 0.1738 |
| 0.2892 | 24100 | - |
| 0.2904 | 24200 | - |
| 0.2916 | 24300 | - |
| 0.2928 | 24400 | - |
| 0.2940 | 24500 | 0.1667 |
| 0.2952 | 24600 | - |
| 0.2964 | 24700 | - |
| 0.2976 | 24800 | - |
| 0.2988 | 24900 | - |
| 0.3000 | 25000 | 0.1562 |
| 0.3012 | 25100 | - |
| 0.3024 | 25200 | - |
| 0.3036 | 25300 | - |
| 0.3048 | 25400 | - |
| 0.3060 | 25500 | 0.1628 |
| 0.3072 | 25600 | - |
| 0.3084 | 25700 | - |
| 0.3096 | 25800 | - |
| 0.3108 | 25900 | - |
| 0.3120 | 26000 | 0.1392 |
| 0.3132 | 26100 | - |
| 0.3144 | 26200 | - |
Framework Versions
- Python: 3.12.10
- Sentence Transformers: 4.1.0
- Transformers: 4.51.3
- PyTorch: 2.6.0+cu124
- Accelerate: 1.8.1
- Datasets: 3.6.0
- Tokenizers: 0.21.1
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}
}
- Downloads last month
- 15
Model tree for lingtrain/labse-chuvash
Base model
sentence-transformers/LaBSE