CoolFace
Modelpublic

Bheri/ithasa-mmbert-gist

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes102downloads
Model Card

SentenceTransformer based on jhu-clsp/mmBERT-base

This is a sentence-transformers model finetuned from jhu-clsp/mmBERT-base. 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: jhu-clsp/mmBERT-base <!-- at revision c5955035435e2bf121cde7f3c8863ef52ff35d82 -->
  • —Maximum Sequence Length: 128 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': 128, 'do_lower_case': False, 'architecture': 'ModernBertModel'})
  (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("sentence_transformers_model_id")
# Run inference
sentences = [
    'attenuated vaccines:',
    'कम संवेदनशील टीकेः',
    '६.५% दसादशे',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.8402, 0.7259],
#         [0.8402, 1.0000, 0.7006],
#         [0.7259, 0.7006, 1.0000]])

<!--

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

Evaluation

Metrics

Translation
MetricValue
src2trg_accuracy0.632
trg2src_accuracy0.63
mean_accuracy0.631

<!--

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: 3,749,530 training samples
  • —Columns: <code>sentence1</code> and <code>sentence2</code>
  • —Approximate statistics based on the first 1000 samples: | | sentence1 | sentence2 | |:--------|:-----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 12 tokens</li><li>mean: 31.26 tokens</li><li>max: 88 tokens</li></ul> | <ul><li>min: 19 tokens</li><li>mean: 67.93 tokens</li><li>max: 128 tokens</li></ul> |
  • —Samples: | sentence1 | sentence2 | |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>There was no Mughal tradition of primogeniture, the systematic passing of rule, upon an emperor's death, to his eldest son.<br></code> | <code>चक्रवर्तिनः मृत्योः अनन्तरं तस्य शासनस्य व्यवस्थितरूपेण सङ्क्रमणस्य, मुघलपरम्परायाः ज्येष्ठपुत्राधिकारपद्धतिः नासीत्।<br></code> | | <code>The four sons of Shah Jahan all held governorships during their father's reign.<br></code> | <code>शाह्-जहाँ-नामकस्य चत्वारः पुत्राः, सर्वे पितुः शासनकाले शासकपदम् अधारयन्।<br></code> | | <code>In this regard he discusses the correlation between social opportunities of education and health and how both of these complement economic and political freedoms as a healthy and well-educated person is better suited to make informed economic decisions and be involved in fruitful political demonstrations etc.<br></code> | <code>अस्मिन् विषये सः शिक्षणस्य स्वास्थ्यस्य च सामाजिकावकाशानाम् अन्योन्य-सम्बन्धस्य, तथा च एतद्द्वयम् अपि आर्थिक-राजनैतिक-स्वातन्त्र्ययोः कथं पूरकं भवतः इति च चर्चां करोति, यतोहि स्वस्था सुशिक्षिता च व्यक्तिः ज्ञानपूर्वम् आर्थिकविषयान् निर्णेतुं तथा फलप्रदेषु राजनैतिकेषु प्रतिपादनादिषु संलग्नः भवितुं च अधिकारी भवति इति।<br></code> |
  • —Loss: <code>CachedGISTEmbedLoss</code> with these parameters:
json
  {
      "guide": "SentenceTransformer('Bheri/labse-en-sa-v1')",
      "temperature": 0.01,
      "mini_batch_size": 32,
      "margin_strategy": "absolute",
      "margin": 0.0,
      "contrast_anchors": true,
      "contrast_positives": true,
      "gather_across_devices": false
  }

Evaluation Dataset

Unnamed Dataset
  • —Size: 1,000 evaluation samples
  • —Columns: <code>sentence1</code> and <code>sentence2</code>
  • —Approximate statistics based on the first 1000 samples: | | sentence1 | sentence2 | |:--------|:---------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 5 tokens</li><li>mean: 11.9 tokens</li><li>max: 67 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 23.13 tokens</li><li>max: 128 tokens</li></ul> |
  • —Samples: | sentence1 | sentence2 | |:------------------------------------------------------------------------------------------|:------------------------------------------------------------| | <code>plus 2 tempered glass screen protectors:</code> | <code>6 पश्चात तापाभिसंतप्तॊ विदुर समार कर्शितः</code> | | <code>"Take sadaqah (alms) from their wealth in order to purify them with it." (p.</code> | <code>अप्येकाङ्गेऽप्यधोवस्तुमिच्छामि च सुकुत्सिते" ॥</code> | | <code>"Who could it possibly be?"</code> | <code>कश्च तासेः सम्भवति ?</code> |
  • —Loss: <code>CachedGISTEmbedLoss</code> with these parameters:
json
  {
      "guide": "SentenceTransformer('Bheri/labse-en-sa-v1')",
      "temperature": 0.01,
      "mini_batch_size": 32,
      "margin_strategy": "absolute",
      "margin": 0.0,
      "contrast_anchors": true,
      "contrast_positives": true,
      "gather_across_devices": false
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —per_device_train_batch_size: 32
  • —num_train_epochs: 5
  • —max_steps: 14000
  • —learning_rate: 2e-05
  • —warmup_steps: 500
  • —gradient_accumulation_steps: 4
  • —bf16: True
  • —eval_strategy: steps
  • —load_best_model_at_end: True
All Hyperparameters

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

  • —per_device_train_batch_size: 32
  • —num_train_epochs: 5
  • —max_steps: 14000
  • —learning_rate: 2e-05
  • —lr_scheduler_type: linear
  • —lr_scheduler_kwargs: None
  • —warmup_steps: 500
  • —optim: adamwtorchfused
  • —optim_args: None
  • —weight_decay: 0.0
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —optim_target_modules: None
  • —gradient_accumulation_steps: 4
  • —average_tokens_across_devices: True
  • —max_grad_norm: 1.0
  • —label_smoothing_factor: 0.0
  • —bf16: True
  • —fp16: False
  • —bf16_full_eval: False
  • —fp16_full_eval: False
  • —tf32: None
  • —gradient_checkpointing: False
  • —gradient_checkpointing_kwargs: None
  • —torch_compile: False
  • —torch_compile_backend: None
  • —torch_compile_mode: None
  • —use_liger_kernel: False
  • —liger_kernel_config: None
  • —use_cache: False
  • —neftune_noise_alpha: None
  • —torch_empty_cache_steps: None
  • —auto_find_batch_size: False
  • —log_on_each_node: True
  • —logging_nan_inf_filter: True
  • —include_num_input_tokens_seen: no
  • —log_level: passive
  • —log_level_replica: warning
  • —disable_tqdm: False
  • —project: huggingface
  • —trackio_space_id: trackio
  • —eval_strategy: steps
  • —per_device_eval_batch_size: 8
  • —prediction_loss_only: True
  • —eval_on_start: False
  • —eval_do_concat_batches: True
  • —eval_use_gather_object: False
  • —eval_accumulation_steps: None
  • —include_for_metrics: []
  • —batch_eval_metrics: False
  • —save_only_model: False
  • —save_on_each_node: False
  • —enable_jit_checkpoint: False
  • —push_to_hub: False
  • —hub_private_repo: None
  • —hub_model_id: None
  • —hub_strategy: every_save
  • —hub_always_push: False
  • —hub_revision: None
  • —load_best_model_at_end: True
  • —ignore_data_skip: False
  • —restore_callback_states_from_checkpoint: False
  • —full_determinism: False
  • —seed: 42
  • —data_seed: None
  • —use_cpu: False
  • —accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • —parallelism_config: None
  • —dataloader_drop_last: False
  • —dataloader_num_workers: 0
  • —dataloader_pin_memory: True
  • —dataloader_persistent_workers: False
  • —dataloader_prefetch_factor: None
  • —remove_unused_columns: True
  • —label_names: None
  • —train_sampling_strategy: random
  • —length_column_name: length
  • —ddp_find_unused_parameters: None
  • —ddp_bucket_cap_mb: None
  • —ddp_broadcast_buffers: False
  • —ddp_backend: None
  • —ddp_timeout: 1800
  • —fsdp: []
  • —fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • —deepspeed: None
  • —debug: []
  • —skip_memory_metrics: True
  • —do_predict: False
  • —resume_from_checkpoint: None
  • —warmup_ratio: None
  • —local_rank: -1
  • —prompts: None
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: proportional
  • —router_mapping: {}
  • —learning_rate_mapping: {}

</details>

Training Logs

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

EpochStepTraining LossValidation Losseval-en-sa_mean_accuracy
0.003410020.6784--
0.006820011.1049--
0.01023003.2979--
0.01374001.8530--
0.01715001.3271--
0.02056001.0448--
0.02397000.8774--
0.02738000.8045--
0.03079000.7365--
0.034110000.67410.27320.5425
0.037611000.6641--
0.041012000.6364--
0.044413000.5756--
0.047814000.5813--
0.051215000.5673--
0.054616000.5489--
0.058017000.5330--
0.061418000.5271--
0.064919000.5327--
0.068320000.49290.19690.5855
0.071721000.4895--
0.075122000.4848--
0.078523000.4926--
0.081924000.4627--
0.085325000.4717--
0.088826000.4835--
0.092227000.4621--
0.095628000.4544--
0.099029000.4634--
0.102430000.43140.16990.599
0.105831000.4392--
0.109232000.4216--
0.112733000.4366--
0.116134000.4305--
0.119535000.4100--
0.122936000.4181--
0.126337000.4238--
0.129738000.4398--
0.133139000.4284--
0.136640000.42020.15050.615
0.140041000.4189--
0.143442000.4228--
0.146843000.4137--
0.150244000.4052--
0.153645000.4041--
0.157046000.3988--
0.160447000.4039--
0.163948000.3977--
0.167349000.3917--
0.170750000.40360.14580.6245
0.174151000.4162--
0.177552000.3984--
0.180953000.4099--
0.184354000.3930--
0.187855000.4112--
0.191256000.4248--
0.194657000.3883--
0.198058000.3970--
0.201459000.3876--
0.204860000.40680.13930.6255
0.208261000.3816--
0.211762000.3938--
0.215163000.3976--
0.218564000.3806--
0.221965000.3930--
0.225366000.4046--
0.228767000.3791--
0.232168000.3708--
0.235569000.3856--
0.239070000.39340.13590.6275
0.242471000.3910--
0.245872000.3860--
0.249273000.3978--
0.252674000.3836--
0.256075000.3862--
0.259476000.3833--
0.262977000.3774--
0.266378000.3938--
0.269779000.3804--
0.273180000.37460.13480.632
0.276581000.3894--
0.279982000.3732--
0.283383000.3674--
0.286884000.3965--
0.290285000.3830--
0.293686000.3857--
0.297087000.3759--
0.300488000.3997--
0.303889000.3764--
0.307290000.37860.13400.633
0.310791000.3709--
0.314192000.3683--
0.317593000.3812--
0.320994000.3760--
0.324395000.3781--
0.327796000.3766--
0.331197000.3704--
0.334598000.3875--
0.338099000.3887--
0.3414100000.39040.13420.633
0.3448101000.3790--
0.3482102000.3639--
0.3516103000.3710--
0.3550104000.3823--
0.3584105000.3829--
0.3619106000.3880--
0.3653107000.3914--
0.3687108000.3638--
0.3721109000.3896--
0.3755110000.38000.13450.629
0.3789111000.3823--
0.3823112000.3773--
0.3858113000.3615--
0.3892114000.3757--
0.3926115000.3690--
0.3960116000.3760--
0.3994117000.3734--
0.4028118000.3948--
0.4062119000.3867--
0.4097120000.38760.13400.631
0.4131121000.3702--
0.4165122000.3882--
0.4199123000.3881--
0.4233124000.3894--
0.4267125000.3823--
0.4301126000.3816--
0.4335127000.3844--
0.4370128000.3782--
0.4404129000.3811--
0.4438130000.3860.13390.6335
0.4472131000.3704--
0.4506132000.3719--
0.4540133000.3936--
0.4574134000.3867--
0.4609135000.3654--
0.4643136000.3614--
0.4677137000.3740--
0.4711138000.3943--
0.4745139000.3793--
0.4779140000.37560.13450.631
  • —The bold row denotes the saved checkpoint. </details>

Framework Versions

  • —Python: 3.10.18
  • —Sentence Transformers: 5.3.0
  • —Transformers: 5.3.0
  • —PyTorch: 2.8.0+cu128
  • —Accelerate: 1.12.0
  • —Datasets: 3.3.2
  • —Tokenizers: 0.22.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",
}

<!--

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