SentenceTransformer based on shihab17/bangla-sentence-transformer

This is a sentence-transformers model finetuned from shihab17/bangla-sentence-transformer. It maps sentences & paragraphs to a 1536-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: shihab17/bangla-sentence-transformer
  • Maximum Sequence Length: 128 tokens
  • Output Dimensionality: 1536 dimensions
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: XLMRobertaModel 
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': True, '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:

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("farhana1996/unsupervised-simcse-bangla-sbert-800k")
# Run inference
sentences = [
    'কারণ এ ব্যাংকগুলোর নিয়ন্ত্রণ অর্থ মন্ত্রণালয়ের ব্যাংক ও আর্থিক প্রতিষ্ঠানের হাতে।',
    'কারণ এ ব্যাংকগুলোর নিয়ন্ত্রণ অর্থ মন্ত্রণালয়ের ব্যাংক ও আর্থিক প্রতিষ্ঠানের হাতে।',
    'বক্তারা এ সময় অবিলম্বে দোষীদের শাস্তির আওতায় না আনলে সারা দেশের আলেম উলামা ও মাদরাসার শিক্ষক শিক্ষার্থীরা রাজপথে নামতে বাধ্য হবে বলে হুশিয়ারি উচ্চারণ করেন।',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1536]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

Training Details

Training Dataset

Unnamed Dataset

  • Size: 800,000 training samples
  • Columns: sentence_0 and sentence_1
  • Approximate statistics based on the first 1000 samples:
    sentence_0 sentence_1
    type string string
    details
    • min: 6 tokens
    • mean: 29.09 tokens
    • max: 128 tokens
    • min: 6 tokens
    • mean: 29.09 tokens
    • max: 128 tokens
  • Samples:
    sentence_0 sentence_1
    এরই মধ্যে এ বিষয়ে পরীক্ষা নিরীক্ষা শুরু করেছে বিশ্ববিদ্যালয় কর্তৃপক্ষ। এরই মধ্যে এ বিষয়ে পরীক্ষা নিরীক্ষা শুরু করেছে বিশ্ববিদ্যালয় কর্তৃপক্ষ।
    এরপর থেকেই যেন দেশের বিজ্ঞাপনে ভারতীয় শিল্পীদের নিয়ে আসার পরিমাণ বেড়ে গেছে। এরপর থেকেই যেন দেশের বিজ্ঞাপনে ভারতীয় শিল্পীদের নিয়ে আসার পরিমাণ বেড়ে গেছে।
    ইন্টারন্যাশনাল ইউনিভার্সিটি অব বিজনেস এগ্রিকালচার অ্যান্ড টেকনোলজির আইইউবিএটি গ্রীষ্ম সেমিস্টারের নতুন শিক্ষার্থীদের পরিচিতি সেশন শেষ হয়েছে। ইন্টারন্যাশনাল ইউনিভার্সিটি অব বিজনেস এগ্রিকালচার অ্যান্ড টেকনোলজির আইইউবিএটি গ্রীষ্ম সেমিস্টারের নতুন শিক্ষার্থীদের পরিচিতি সেশন শেষ হয়েছে।
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • num_train_epochs: 2
  • fp16: True
  • multi_dataset_batch_sampler: round_robin

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: no
  • prediction_loss_only: True
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • 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.0
  • num_train_epochs: 2
  • 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: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • tp_size: 0
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': 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

Training Logs

Click to expand
Epoch Step Training Loss
0.01 500 0.0128
0.02 1000 0.0006
0.03 1500 0.0003
0.04 2000 0.0002
0.05 2500 0.0002
0.06 3000 0.0001
0.07 3500 0.0001
0.08 4000 0.0002
0.09 4500 0.0001
0.1 5000 0.0001
0.11 5500 0.0001
0.12 6000 0.0
0.13 6500 0.0001
0.14 7000 0.0001
0.15 7500 0.0001
0.16 8000 0.0
0.17 8500 0.0
0.18 9000 0.0
0.19 9500 0.0
0.2 10000 0.0
0.21 10500 0.0001
0.22 11000 0.0001
0.23 11500 0.0001
0.24 12000 0.0
0.25 12500 0.0002
0.26 13000 0.0
0.27 13500 0.0
0.28 14000 0.0
0.29 14500 0.0
0.3 15000 0.0002
0.31 15500 0.0
0.32 16000 0.0
0.33 16500 0.0
0.34 17000 0.0
0.35 17500 0.0
0.36 18000 0.0
0.37 18500 0.0
0.38 19000 0.0
0.39 19500 0.0
0.4 20000 0.0
0.41 20500 0.0
0.42 21000 0.0
0.43 21500 0.0
0.44 22000 0.0
0.45 22500 0.0
0.46 23000 0.0
0.47 23500 0.0
0.48 24000 0.0
0.49 24500 0.0
0.5 25000 0.0
0.51 25500 0.0
0.52 26000 0.0
0.53 26500 0.0
0.54 27000 0.0
0.55 27500 0.0
0.56 28000 0.0
0.57 28500 0.0
0.58 29000 0.0
0.59 29500 0.0
0.6 30000 0.0
0.61 30500 0.0
0.62 31000 0.0
0.63 31500 0.0
0.64 32000 0.0
0.65 32500 0.0
0.66 33000 0.0
0.67 33500 0.0
0.68 34000 0.0
0.69 34500 0.0
0.7 35000 0.0
0.71 35500 0.0
0.72 36000 0.0
0.73 36500 0.0
0.74 37000 0.0
0.75 37500 0.0
0.76 38000 0.0
0.77 38500 0.0
0.78 39000 0.0
0.79 39500 0.0
0.8 40000 0.0
0.81 40500 0.0
0.82 41000 0.0
0.83 41500 0.0
0.84 42000 0.0
0.85 42500 0.0
0.86 43000 0.0
0.87 43500 0.0
0.88 44000 0.0
0.89 44500 0.0
0.9 45000 0.0
0.91 45500 0.0
0.92 46000 0.0
0.93 46500 0.0
0.94 47000 0.0
0.95 47500 0.0
0.96 48000 0.0
0.97 48500 0.0
0.98 49000 0.0
0.99 49500 0.0
1.0 50000 0.0
1.01 50500 0.0
1.02 51000 0.0
1.03 51500 0.0
1.04 52000 0.0
1.05 52500 0.0
1.06 53000 0.0
1.07 53500 0.0
1.08 54000 0.0
1.09 54500 0.0
1.1 55000 0.0
1.11 55500 0.0
1.12 56000 0.0
1.13 56500 0.0
1.1400 57000 0.0
1.15 57500 0.0
1.16 58000 0.0
1.17 58500 0.0
1.18 59000 0.0
1.19 59500 0.0
1.2 60000 0.0
1.21 60500 0.0
1.22 61000 0.0
1.23 61500 0.0
1.24 62000 0.0
1.25 62500 0.0
1.26 63000 0.0
1.27 63500 0.0
1.28 64000 0.0
1.29 64500 0.0
1.3 65000 0.0
1.31 65500 0.0
1.32 66000 0.0
1.33 66500 0.0
1.34 67000 0.0
1.35 67500 0.0
1.3600 68000 0.0
1.37 68500 0.0
1.38 69000 0.0
1.3900 69500 0.0
1.4 70000 0.0
1.41 70500 0.0
1.42 71000 0.0
1.43 71500 0.0
1.44 72000 0.0
1.45 72500 0.0
1.46 73000 0.0
1.47 73500 0.0
1.48 74000 0.0
1.49 74500 0.0
1.5 75000 0.0
1.51 75500 0.0
1.52 76000 0.0
1.53 76500 0.0
1.54 77000 0.0
1.55 77500 0.0
1.56 78000 0.0
1.5700 78500 0.0
1.58 79000 0.0
1.5900 79500 0.0
1.6 80000 0.0
1.6100 80500 0.0
1.62 81000 0.0
1.63 81500 0.0
1.6400 82000 0.0
1.65 82500 0.0
1.6600 83000 0.0
1.67 83500 0.0
1.6800 84000 0.0
1.69 84500 0.0
1.7 85000 0.0001
1.71 85500 0.0
1.72 86000 0.0
1.73 86500 0.0
1.74 87000 0.0
1.75 87500 0.0
1.76 88000 0.0
1.77 88500 0.0
1.78 89000 0.0
1.79 89500 0.0002
1.8 90000 0.0
1.81 90500 0.0
1.8200 91000 0.0
1.83 91500 0.0
1.8400 92000 0.0
1.85 92500 0.0
1.8600 93000 0.0
1.87 93500 0.0
1.88 94000 0.0
1.8900 94500 0.0
1.9 95000 0.0
1.9100 95500 0.0
1.92 96000 0.0
1.9300 96500 0.0
1.94 97000 0.0
1.95 97500 0.0
1.96 98000 0.0
1.97 98500 0.0
1.98 99000 0.0
1.99 99500 0.0
2.0 100000 0.0

Framework Versions

  • Python: 3.11.11
  • Sentence Transformers: 3.4.1
  • Transformers: 4.51.1
  • PyTorch: 2.5.1+cu124
  • Accelerate: 1.3.0
  • Datasets: 3.5.0
  • Tokenizers: 0.21.0

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
3
Safetensors
Model size
278M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for farhana1996/unsupervised-simcse-bangla-sbert-800k

Finetuned
(5)
this model