SentenceTransformer based on BookingCare/gte-multilingual-base-v2.1

This is a sentence-transformers model finetuned from BookingCare/gte-multilingual-base-v2.1 on the train and test datasets. 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 Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 8192, 'do_lower_case': False}) with Transformer model: NewModel 
  (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): 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("BookingCare/gte-multilingual-base-v2.1-similarity")
# Run inference
sentences = [
    'Tôi muốn tìm hiểu về dịch vụ khám chữa bệnh tại phòng khám đa khoa Cầu Giấy.',
    'Cho tôi biết thông tin về phòng khám đa khoa Cầu Giấy, cụ thể là dịch vụ khám chữa bệnh.',
    'Những dịch vụ y tế nào được cung cấp tại bệnh viện Đa khoa Hà Nội?',
]
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]

Evaluation

Metrics

Triplet

Metric Value
cosine_accuracy 0.969

Training Details

Training Datasets

train

  • Dataset: train at 54473e6
  • Size: 46,571 training samples
  • Columns: query, answer, and negative
  • Approximate statistics based on the first 1000 samples:
    query answer negative
    type string string string
    details
    • min: 3 tokens
    • mean: 19.92 tokens
    • max: 72 tokens
    • min: 9 tokens
    • mean: 21.43 tokens
    • max: 75 tokens
    • min: 9 tokens
    • mean: 20.46 tokens
    • max: 58 tokens
  • Samples:
    query answer negative
    Các bác sĩ đã đề nghị phẫu thuật để điều trị bệnh nhân bị ung thư gan giai đoạn cuối. Bệnh nhân bị ung thư gan giai đoạn cuối đã được bác sĩ đề nghị phẫu thuật. Bệnh nhân được chẩn đoán mắc bệnh ung thư giai đoạn cuối, và cơ hội phục hồi là rất thấp.
    Cơn đau đầu của tôi bắt đầu vào sáng nay và đã trở nên tồi tệ hơn trong suốt cả ngày. Tôi đã phải chịu đựng cơn đau đầu dữ dội suốt cả ngày, bắt đầu từ sáng sớm. Tôi bị đau đầu nghiêm trọng, nên làm gì?
    Mẹ tôi phải nhập viện vì bệnh tim. Mẹ tôi bị bệnh tim và phải nhập viện để điều trị. Bệnh nhân đã được chẩn đoán mắc bệnh tim trước đây.
  • Loss: TripletLoss with these parameters:
    {
        "distance_metric": "TripletDistanceMetric.EUCLIDEAN",
        "triplet_margin": 5
    }
    

test

  • Dataset: test at 54473e6
  • Size: 46,571 training samples
  • Columns: query, answer, and negative
  • Approximate statistics based on the first 1000 samples:
    query answer negative
    type string string string
    details
    • min: 3 tokens
    • mean: 20.12 tokens
    • max: 62 tokens
    • min: 9 tokens
    • mean: 21.51 tokens
    • max: 54 tokens
    • min: 9 tokens
    • mean: 20.19 tokens
    • max: 56 tokens
  • Samples:
    query answer negative
    Tôi cần tìm hiểu về bệnh u nang buồng trứng, triệu chứng, phương pháp điều trị và những lưu ý Cho tôi biết thông tin về bệnh u nang buồng trứng, bao gồm các triệu chứng, cách điều trị và những điểm cần chú ý Cho tôi thông tin về bệnh ung thư vú
    Tôi muốn tìm hiểu về các loại thuốc trị bệnh dạ dày Cho tôi biết thông tin về thuốc điều trị bệnh dạ dày Làm ơn cho tôi biết về các loại thuốc điều trị bệnh tiểu đường
    Viêm khớp tâm bình có thể bị thu hồi hoàn toàn không? Liệu viêm khớp tâm bình có thể khỏi hẳn hay không? Viêm khớp dạng thấp có khả năng chữa khỏi hoàn toàn hay không?
  • Loss: TripletLoss with these parameters:
    {
        "distance_metric": "TripletDistanceMetric.EUCLIDEAN",
        "triplet_margin": 5
    }
    

Evaluation Dataset

sts-hard-negatives

  • Dataset: sts-hard-negatives at 54473e6
  • Size: 46,571 evaluation samples
  • Columns: query, answer, and negative
  • Approximate statistics based on the first 1000 samples:
    query answer negative
    type string string string
    details
    • min: 3 tokens
    • mean: 20.12 tokens
    • max: 62 tokens
    • min: 9 tokens
    • mean: 21.51 tokens
    • max: 54 tokens
    • min: 9 tokens
    • mean: 20.19 tokens
    • max: 56 tokens
  • Samples:
    query answer negative
    Tôi cần tìm hiểu về bệnh u nang buồng trứng, triệu chứng, phương pháp điều trị và những lưu ý Cho tôi biết thông tin về bệnh u nang buồng trứng, bao gồm các triệu chứng, cách điều trị và những điểm cần chú ý Cho tôi thông tin về bệnh ung thư vú
    Tôi muốn tìm hiểu về các loại thuốc trị bệnh dạ dày Cho tôi biết thông tin về thuốc điều trị bệnh dạ dày Làm ơn cho tôi biết về các loại thuốc điều trị bệnh tiểu đường
    Viêm khớp tâm bình có thể bị thu hồi hoàn toàn không? Liệu viêm khớp tâm bình có thể khỏi hẳn hay không? Viêm khớp dạng thấp có khả năng chữa khỏi hoàn toàn hay không?
  • Loss: TripletLoss with these parameters:
    {
        "distance_metric": "TripletDistanceMetric.EUCLIDEAN",
        "triplet_margin": 5
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • num_train_epochs: 4
  • warmup_ratio: 0.1
  • fp16: True

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • 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: 4
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.1
  • 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}
  • 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
  • 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: proportional

Training Logs

Epoch Step Training Loss Validation Loss cosine_accuracy
0.0763 200 4.7 4.4035 0.9647
0.1527 400 4.5516 4.2237 0.9435
0.2290 600 4.415 4.1196 0.9458
0.3053 800 4.3305 4.0727 0.9427
0.3817 1000 4.2839 4.0611 0.9323
0.4580 1200 4.2436 4.0407 0.9339
0.5344 1400 4.2053 4.0485 0.9218
0.6107 1600 4.2176 4.0233 0.9275
0.6870 1800 4.1828 3.9883 0.9308
0.7634 2000 4.1132 3.9867 0.9296
0.8397 2200 4.0697 3.9551 0.9277
0.9160 2400 4.0714 3.9313 0.9265
0.9924 2600 4.0625 3.9284 0.9239
1.0687 2800 4.0286 3.9026 0.9275
1.1450 3000 3.9907 3.9427 0.9213
1.2214 3200 4.0341 3.9621 0.9210
1.2977 3400 4.0037 3.9111 0.9260
1.3740 3600 4.013 3.9063 0.9289
1.4504 3800 3.9897 3.8785 0.9377
1.5267 4000 3.9658 3.8765 0.9368
1.6031 4200 3.9903 3.8619 0.9389
1.6794 4400 3.9599 3.8734 0.9339
1.7557 4600 3.9375 3.8636 0.9399
1.8321 4800 3.9197 3.8382 0.9404
1.9084 5000 3.9611 3.8310 0.9444
1.9847 5200 3.9434 3.8272 0.9427
2.0611 5400 3.8825 3.8157 0.9447
2.1374 5600 3.8859 3.8231 0.9430
2.2137 5800 3.8924 3.7948 0.9501
2.2901 6000 3.8957 3.7889 0.9504
2.3664 6200 3.8511 3.7722 0.9528
2.4427 6400 3.8598 3.7654 0.9561
2.5191 6600 3.8472 3.7569 0.9554
2.5954 6800 3.8558 3.7496 0.9528
2.6718 7000 3.829 3.7514 0.9552
2.7481 7200 3.8564 3.7346 0.9568
2.8244 7400 3.8392 3.7338 0.9599
2.9008 7600 3.8003 3.7309 0.9604
2.9771 7800 3.7936 3.7288 0.9611
3.0534 8000 3.7783 3.7181 0.9618
3.1298 8200 3.7586 3.7136 0.9652
3.2061 8400 3.7806 3.7101 0.9637
3.2824 8600 3.7669 3.7049 0.9628
3.3588 8800 3.7819 3.7024 0.9642
3.4351 9000 3.7685 3.6965 0.9628
3.5115 9200 3.7607 3.6920 0.9656
3.5878 9400 3.7601 3.6840 0.9652
3.6641 9600 3.7607 3.6791 0.9661
3.7405 9800 3.7387 3.6750 0.9692
3.8168 10000 3.724 3.6706 0.9707
3.8931 10200 3.7889 3.6682 0.9688
3.9695 10400 3.7525 3.6670 0.9690

Framework Versions

  • Python: 3.11.11
  • Sentence Transformers: 3.4.1
  • Transformers: 4.48.3
  • PyTorch: 2.5.1+cu124
  • Accelerate: 1.3.0
  • Datasets: 3.3.1
  • 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",
}

TripletLoss

@misc{hermans2017defense,
    title={In Defense of the Triplet Loss for Person Re-Identification},
    author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
    year={2017},
    eprint={1703.07737},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}
Downloads last month
10
Safetensors
Model size
305M params
Tensor type
F32
·
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.

Model tree for BookingCare/gte-multilingual-base-v2.1-similarity

Dataset used to train BookingCare/gte-multilingual-base-v2.1-similarity

Evaluation results