CoolFace
Modelpublic

lingtrain/labse-chuvash

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes67downloads
Model Card

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 <!-- at revision 836121a0533e5664b21c7aacc5d22951f2b8b25b -->
  • Maximum Sequence Length: 256 tokens
  • Output Dimensionality: 768 dimensions
  • Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

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:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
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]

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

Unnamed Dataset
  • Size: 1,000,000 training samples
  • Columns: <code>sentence0</code>, <code>sentence1</code>, and <code>label</code>
  • Approximate statistics based on the first 1000 samples: | | sentence0 | sentence1 | label | |:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:--------------------------------------------------------------| | type | string | string | float | | details | <ul><li>min: 3 tokens</li><li>mean: 21.82 tokens</li><li>max: 127 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 21.16 tokens</li><li>max: 136 tokens</li></ul> | <ul><li>min: 1.0</li><li>mean: 1.0</li><li>max: 1.0</li></ul> |
  • Samples: | sentence0 | sentence1 | label | |:-----------------------------------------------------------------------------------|:--------------------------------------------------------------|:-----------------| | <code>Темех мар.</code> | <code>Дело десятое.</code> | <code>1.0</code> | | <code>Уругвайӑн тĕн ĕҫченĕсем</code> | <code>Религиозные деятели Уругвая</code> | <code>1.0</code> | | <code>Эп аванах ас тӑватӑп, пилӗк ҫул каялла пахчана эпир лайӑх тасатнӑччӗ.</code> | <code>А пять лет тому назад я знал, что сад был чищен.</code> | <code>1.0</code> |
  • Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • eval_strategy: steps
  • per_device_train_batch_size: 12
  • per_device_eval_batch_size: 12
  • num_train_epochs: 1
  • fp16: True
  • multi_dataset_batch_sampler: round_robin
All Hyperparameters

<details><summary>Click to expand</summary>

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 12
  • per_device_eval_batch_size: 12
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 5e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1
  • num_train_epochs: 1
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.0
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: False
  • fp16: True
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • tp_size: 0
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: None
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin

</details>

Training Logs

<details><summary>Click to expand</summary>

EpochStepTraining Loss
0.0012100-
0.0024200-
0.0036300-
0.0048400-
0.00605000.5331
0.0072600-
0.0084700-
0.0096800-
0.0108900-
0.012010000.3694
0.01321100-
0.01441200-
0.01561300-
0.01681400-
0.018015000.3141
0.01921600-
0.02041700-
0.02161800-
0.02281900-
0.024020000.2836
0.02522100-
0.02642200-
0.02762300-
0.02882400-
0.030025000.2823
0.03122600-
0.03242700-
0.03362800-
0.03482900-
0.036030000.265
0.03723100-
0.03843200-
0.03963300-
0.04083400-
0.042035000.2599
0.04323600-
0.04443700-
0.04563800-
0.04683900-
0.048040000.234
0.04924100-
0.05044200-
0.05164300-
0.05284400-
0.054045000.1966
0.05524600-
0.05644700-
0.05764800-
0.05884900-
0.060050000.2204
0.06125100-
0.06245200-
0.06365300-
0.06485400-
0.066055000.2272
0.06725600-
0.06845700-
0.06965800-
0.07085900-
0.072060000.2256
0.07326100-
0.07446200-
0.07566300-
0.07686400-
0.078065000.2071
0.07926600-
0.08046700-
0.08166800-
0.08286900-
0.084070000.2113
0.08527100-
0.08647200-
0.08767300-
0.08887400-
0.090075000.2222
0.09127600-
0.09247700-
0.09367800-
0.09487900-
0.096080000.2186
0.09728100-
0.09848200-
0.09968300-
0.10088400-
0.102085000.2137
0.10328600-
0.10448700-
0.10568800-
0.10688900-
0.108090000.1928
0.10929100-
0.11049200-
0.11169300-
0.11289400-
0.114095000.2117
0.11529600-
0.11649700-
0.11769800-
0.11889900-
0.1200100000.1987
0.121210100-
0.122410200-
0.123610300-
0.124810400-
0.1260105000.2011
0.127210600-
0.128410700-
0.129610800-
0.130810900-
0.1320110000.1775
0.133211100-
0.134411200-
0.135611300-
0.136811400-
0.1380115000.2048
0.139211600-
0.140411700-
0.141611800-
0.142811900-
0.1440120000.2064
0.145212100-
0.146412200-
0.147612300-
0.148812400-
0.1500125000.1883
0.151212600-
0.152412700-
0.153612800-
0.154812900-
0.1560130000.2084
0.157213100-
0.158413200-
0.159613300-
0.160813400-
0.1620135000.2077
0.163213600-
0.164413700-
0.165613800-
0.166813900-
0.1680140000.1866
0.169214100-
0.170414200-
0.171614300-
0.172814400-
0.1740145000.1859
0.175214600-
0.176414700-
0.177614800-
0.178814900-
0.1800150000.1735
0.181215100-
0.182415200-
0.183615300-
0.184815400-
0.1860155000.171
0.187215600-
0.188415700-
0.189615800-
0.190815900-
0.1920160000.1465
0.193216100-
0.194416200-
0.195616300-
0.196816400-
0.1980165000.1921
0.199216600-
0.200416700-
0.201616800-
0.202816900-
0.2040170000.1669
0.205217100-
0.206417200-
0.207617300-
0.208817400-
0.2100175000.1656
0.211217600-
0.212417700-
0.213617800-
0.214817900-
0.2160180000.1952
0.217218100-
0.218418200-
0.219618300-
0.220818400-
0.2220185000.1658
0.223218600-
0.224418700-
0.225618800-
0.226818900-
0.2280190000.1774
0.229219100-
0.230419200-
0.231619300-
0.232819400-
0.2340195000.1802
0.235219600-
0.236419700-
0.237619800-
0.238819900-
0.2400200000.1724
0.241220100-
0.242420200-
0.243620300-
0.244820400-
0.2460205000.1653
0.247220600-
0.248420700-
0.249620800-
0.250820900-
0.2520210000.1484
0.253221100-
0.254421200-
0.255621300-
0.256821400-
0.2580215000.1544
0.259221600-
0.260421700-
0.261621800-
0.262821900-
0.2640220000.174
0.265222100-
0.266422200-
0.267622300-
0.268822400-
0.2700225000.1488
0.271222600-
0.272422700-
0.273622800-
0.274822900-
0.2760230000.1696
0.277223100-
0.278423200-
0.279623300-
0.280823400-
0.2820235000.1468
0.283223600-
0.284423700-
0.285623800-
0.286823900-
0.2880240000.1738
0.289224100-
0.290424200-
0.291624300-
0.292824400-
0.2940245000.1667
0.295224600-
0.296424700-
0.297624800-
0.298824900-
0.3000250000.1562
0.301225100-
0.302425200-
0.303625300-
0.304825400-
0.3060255000.1628
0.307225600-
0.308425700-
0.309625800-
0.310825900-
0.3120260000.1392
0.313226100-
0.314426200-

</details>

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
bibtex
@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
bibtex
@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}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->