CoolFace
Modelpublic

agentlans/distilbert-base-multilingual-cased-aligned

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes17downloads
Model Card

SentenceTransformer based on distilbert/distilbert-base-multilingual-cased

This is a sentence-transformers model finetuned from distilbert/distilbert-base-multilingual-cased. 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: distilbert/distilbert-base-multilingual-cased <!-- at revision 45c032ab32cc946ad88a166f7cb282f58c753c2e -->
  • Maximum Sequence Length: 512 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': 512, 'do_lower_case': False}) with Transformer model: DistilBertModel 
  (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})
)

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("agentlans/distilbert-base-multilingual-cased-aligned")
# Run inference
sentences = [
    'Palm DOC Conduit for KPilot',
    'PalmDOC- conduit foar KPilot',
    'Man nepatinka gyventi kaime.',
]
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: 867,042 training samples
  • Columns: <code>sentence0</code> and <code>sentence1</code>
  • Approximate statistics based on the first 1000 samples: | | sentence0 | sentence1 | |:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 3 tokens</li><li>mean: 21.88 tokens</li><li>max: 121 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 30.11 tokens</li><li>max: 230 tokens</li></ul> |
  • Samples: | sentence0 | sentence1 | |:-----------------------------------------------------------------------|:------------------------------------------------------------------------| | <code>They need to be internationally recognized and supported.</code> | <code>Mereka harus diakui dan dibantu secara internasional.</code> | | <code>I ride with these kids once a week, every Tuesday.</code> | <code>Ik rijd met deze kinderen een keer per week, elke dinsdag.</code> | | <code>We still have some.</code> | <code>අපි ගාව තව ඒවා තියෙනවනේ.</code> |
  • Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • num_train_epochs: 1
  • multi_dataset_batch_sampler: round_robin
All Hyperparameters

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

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: no
  • prediction_loss_only: True
  • per_device_train_batch_size: 8
  • per_device_eval_batch_size: 8
  • 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: False
  • 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}
  • 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: False
  • 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
  • dispatch_batches: None
  • split_batches: 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.00465000.1996
0.009210000.087
0.013815000.0771
0.018520000.0646
0.023125000.0443
0.027730000.0526
0.032335000.05
0.036940000.0479
0.041545000.0477
0.046150000.0427
0.050755000.0343
0.055460000.0358
0.060065000.0452
0.064670000.0397
0.069275000.0289
0.073880000.0274
0.078485000.0364
0.083090000.0283
0.087795000.0295
0.0923100000.0337
0.0969105000.0303
0.1015110000.0252
0.1061115000.0241
0.1107120000.0225
0.1153125000.0263
0.1199130000.0255
0.1246135000.0311
0.1292140000.0201
0.1338145000.0209
0.1384150000.0205
0.1430155000.0242
0.1476160000.0332
0.1522165000.0346
0.1569170000.0225
0.1615175000.0245
0.1661180000.0166
0.1707185000.0196
0.1753190000.0264
0.1799195000.0212
0.1845200000.0201
0.1891205000.0238
0.1938210000.0175
0.1984215000.022
0.2030220000.0201
0.2076225000.0197
0.2122230000.0137
0.2168235000.017
0.2214240000.031
0.2261245000.0238
0.2307250000.0194
0.2353255000.024
0.2399260000.022
0.2445265000.0276
0.2491270000.016
0.2537275000.0203
0.2583280000.0245
0.2630285000.0161
0.2676290000.0132
0.2722295000.0142
0.2768300000.0171
0.2814305000.0207
0.2860310000.0189
0.2906315000.0169
0.2953320000.0225
0.2999325000.0224
0.3045330000.0114
0.3091335000.0213
0.3137340000.0146
0.3183345000.0154
0.3229350000.0218
0.3275355000.0096
0.3322360000.0147
0.3368365000.0186
0.3414370000.0214
0.3460375000.0231
0.3506380000.0165
0.3552385000.0157
0.3598390000.0128
0.3645395000.018
0.3691400000.0183
0.3737405000.0203
0.3783410000.02
0.3829415000.0165
0.3875420000.0128
0.3921425000.0106
0.3967430000.0174
0.4014435000.0168
0.4060440000.0114
0.4106445000.0158
0.4152450000.0108
0.4198455000.0141
0.4244460000.0137
0.4290465000.0137
0.4337470000.0215
0.4383475000.0123
0.4429480000.0138
0.4475485000.0152
0.4521490000.0144
0.4567495000.016
0.4613500000.0132
0.4659505000.0164
0.4706510000.0155
0.4752515000.0145
0.4798520000.0173
0.4844525000.02
0.4890530000.0168
0.4936535000.011
0.4982540000.0116
0.5029545000.009
0.5075550000.0143
0.5121555000.0111
0.5167560000.0138
0.5213565000.0104
0.5259570000.0146
0.5305575000.0116
0.5351580000.0157
0.5398585000.013
0.5444590000.0144
0.5490595000.0134
0.5536600000.0114
0.5582605000.0101
0.5628610000.0164
0.5674615000.0151
0.5721620000.0138
0.5767625000.0107
0.5813630000.0102
0.5859635000.0153
0.5905640000.0103
0.5951645000.0136
0.5997650000.0107
0.6043655000.0101
0.6090660000.0101
0.6136665000.0117
0.6182670000.0113
0.6228675000.0131
0.6274680000.0068
0.6320685000.0053
0.6366690000.0113
0.6413695000.0119
0.6459700000.0094
0.6505705000.0072
0.6551710000.0171
0.6597715000.0121
0.6643720000.0134
0.6689725000.0147
0.6735730000.0075
0.6782735000.0125
0.6828740000.0064
0.6874745000.0071
0.6920750000.0073
0.6966755000.0075
0.7012760000.0097
0.7058765000.01
0.7105770000.0123
0.7151775000.0093
0.7197780000.0103
0.7243785000.0179
0.7289790000.0091
0.7335795000.0121
0.7381800000.0104
0.7428805000.0083
0.7474810000.0116
0.7520815000.0084
0.7566820000.0077
0.7612825000.0081
0.7658830000.0101
0.7704835000.0093
0.7750840000.0095
0.7797845000.0107
0.7843850000.0108
0.7889855000.0095
0.7935860000.0082
0.7981865000.0103
0.8027870000.0069
0.8073875000.009
0.8120880000.0081
0.8166885000.0074
0.8212890000.0069
0.8258895000.0066
0.8304900000.0065
0.8350905000.0065
0.8396910000.0088
0.8442915000.008
0.8489920000.0069
0.8535925000.0095
0.8581930000.0082
0.8627935000.0068
0.8673940000.006
0.8719945000.0082
0.8765950000.0121
0.8812955000.0098
0.8858960000.0083
0.8904965000.008
0.8950970000.0053
0.8996975000.0102
0.9042980000.0093
0.9088985000.0042
0.9134990000.0093
0.9181995000.0138
0.92271000000.0105
0.92731005000.0079
0.93191010000.0118
0.93651015000.0072
0.94111020000.0094
0.94571025000.0108
0.95041030000.0092
0.95501035000.0062
0.95961040000.0073
0.96421045000.0089
0.96881050000.0092
0.97341055000.0076
0.97801060000.0103
0.98261065000.0064
0.98731070000.0072
0.99191075000.0052
0.99651080000.0061

</details>

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 3.3.0
  • Transformers: 4.46.3
  • PyTorch: 2.5.1+cu124
  • Accelerate: 1.1.1
  • Datasets: 3.1.0
  • Tokenizers: 0.20.3

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. -->