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 Type: Sentence Transformer
- Base model: BookingCare/gte-multilingual-base-v2.1
- Maximum Sequence Length: 8192 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
- Training Datasets:
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
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
- Evaluated with
TripletEvaluator
Metric | Value |
---|---|
cosine_accuracy | 0.969 |
Training Details
Training Datasets
train
- Dataset: train at 54473e6
- Size: 46,571 training samples
- Columns:
query
,answer
, andnegative
- 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
, andnegative
- 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
, andnegative
- 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
: stepsper_device_train_batch_size
: 16per_device_eval_batch_size
: 16num_train_epochs
: 4warmup_ratio
: 0.1fp16
: True
All Hyperparameters
Click to expand
overwrite_output_dir
: Falsedo_predict
: Falseeval_strategy
: stepsprediction_loss_only
: Trueper_device_train_batch_size
: 16per_device_eval_batch_size
: 16per_gpu_train_batch_size
: Noneper_gpu_eval_batch_size
: Nonegradient_accumulation_steps
: 1eval_accumulation_steps
: Nonetorch_empty_cache_steps
: Nonelearning_rate
: 5e-05weight_decay
: 0.0adam_beta1
: 0.9adam_beta2
: 0.999adam_epsilon
: 1e-08max_grad_norm
: 1.0num_train_epochs
: 4max_steps
: -1lr_scheduler_type
: linearlr_scheduler_kwargs
: {}warmup_ratio
: 0.1warmup_steps
: 0log_level
: passivelog_level_replica
: warninglog_on_each_node
: Truelogging_nan_inf_filter
: Truesave_safetensors
: Truesave_on_each_node
: Falsesave_only_model
: Falserestore_callback_states_from_checkpoint
: Falseno_cuda
: Falseuse_cpu
: Falseuse_mps_device
: Falseseed
: 42data_seed
: Nonejit_mode_eval
: Falseuse_ipex
: Falsebf16
: Falsefp16
: Truefp16_opt_level
: O1half_precision_backend
: autobf16_full_eval
: Falsefp16_full_eval
: Falsetf32
: Nonelocal_rank
: 0ddp_backend
: Nonetpu_num_cores
: Nonetpu_metrics_debug
: Falsedebug
: []dataloader_drop_last
: Falsedataloader_num_workers
: 0dataloader_prefetch_factor
: Nonepast_index
: -1disable_tqdm
: Falseremove_unused_columns
: Truelabel_names
: Noneload_best_model_at_end
: Falseignore_data_skip
: Falsefsdp
: []fsdp_min_num_params
: 0fsdp_config
: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap
: Noneaccelerator_config
: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed
: Nonelabel_smoothing_factor
: 0.0optim
: adamw_torchoptim_args
: Noneadafactor
: Falsegroup_by_length
: Falselength_column_name
: lengthddp_find_unused_parameters
: Noneddp_bucket_cap_mb
: Noneddp_broadcast_buffers
: Falsedataloader_pin_memory
: Truedataloader_persistent_workers
: Falseskip_memory_metrics
: Trueuse_legacy_prediction_loop
: Falsepush_to_hub
: Falseresume_from_checkpoint
: Nonehub_model_id
: Nonehub_strategy
: every_savehub_private_repo
: Nonehub_always_push
: Falsegradient_checkpointing
: Falsegradient_checkpointing_kwargs
: Noneinclude_inputs_for_metrics
: Falseinclude_for_metrics
: []eval_do_concat_batches
: Truefp16_backend
: autopush_to_hub_model_id
: Nonepush_to_hub_organization
: Nonemp_parameters
:auto_find_batch_size
: Falsefull_determinism
: Falsetorchdynamo
: Noneray_scope
: lastddp_timeout
: 1800torch_compile
: Falsetorch_compile_backend
: Nonetorch_compile_mode
: Nonedispatch_batches
: Nonesplit_batches
: Noneinclude_tokens_per_second
: Falseinclude_num_input_tokens_seen
: Falseneftune_noise_alpha
: Noneoptim_target_modules
: Nonebatch_eval_metrics
: Falseeval_on_start
: Falseuse_liger_kernel
: Falseeval_use_gather_object
: Falseaverage_tokens_across_devices
: Falseprompts
: Nonebatch_sampler
: batch_samplermulti_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
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
Base model
Alibaba-NLP/gte-multilingual-base
Finetuned
BookingCare/gte-multilingual-base-v2.1