Downloads · 30 days
53
17% of all-time downloads
meandyou200175/paraphrase-multilingual-MiniLM-L12-v2_finetune
paraphrase-multilingual-MiniLM-L12-v2_finetune is a sentence similarity model from meandyou200175. Use it when you need a score for how close two texts are. It is set up for sentence-transformers.
This is a sentence-transformers model finetuned from sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic tex…
Downloads · 30 days
53
17% of all-time downloads
All-time downloads
306
Public
Parameters
118M
973 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors471 MB · 94%
From the Hugging Face model README
This is a sentence-transformers model finetuned from sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
SentenceTransformer(
(0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 384, '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})
)
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("meandyou200175/paraphrase-multilingual-MiniLM-L12-v2_finetune")
# Run inference
sentences = [
'Chào bác sĩ. Em đi khám ở bệnh viện đa khoa bác sĩ kết luận là em bị đa nhân 2 thùy tuyến giáp tirads 3 kém đồng nhất 2 thùy tuyến giáp. Nang thùy trái tuyến giáp vậy có nguy hiểm không ạ? Em hoang mang quá ạ.',
'Chào em, Phân loại Ti-rads là phân loại tiên lượng ác tính của nhân giáp trên siêu âm. + TI-RADS-1: Mô giáp lành. + TI-RADS-2: Các tổn thương lành tính (0% nguy cơ ác tính). + TI-RADS-3: Các tổn thương nhiều khả năng lành tính (1,7% ác tính). + TI-RADS-4: 4a: Tổn thương có 1 dấu hiệu siêu âm nghi ngờ (3,3% ác tính). 4b: Tổn thương có 2 dấu hiệu siêu âm nghi ngờ (9,2% ác tính). 4c: Tổn thương có 3-4 dấu hiệu siêu âm nghi ngờ (44,4-72,4% ác tính). + TI-RADS-5: có từ 5 trở lên dấu hiệu siêu âm nghi ngờ (87,5% ác tính). + TI-RADS-6: Biết chắc chắn bướu ác tính trước đó. Theo kết quả mô tả siêu âm tuyến giáp của em thì hai nhân giáp thùy phải và thùy trái của em được đánh giá là tirads 3 (phân độ nguy cơ ác tính của nhân giáp), tức là nhiều khả năng lành tính và có 1,7% nguy cơ ác tính mà thôi. Đối với nhân giáp tirads 3, nguy cơ ác tính thấp, thì việc quyết định nên sinh thiết hay theo dõi sẽ cần dựa vào nhiều yếu tố khác, như nhân giáp này có làm rối loạn hormone tuyến giáp hay không, tiền căn gia đình có ai bị ung thư không, bản thân em có từng chiếu xạ vùng đầu mặt cổ không… Do đó, em cần khám chuyên khoa Giáp, thuộc chuyên khoa Nội tiết hoặc chuyên khoa Ung bướu để bác sĩ xem lại biên bản siêu âm, khai thác thêm những thông tin về bản thân và gia đình em, làm thêm xét nghiệm nếu chưa đủ (như xét nghiệm kiểm tra chức năng tuyến giáp) từ đó mới đưa ra kết luận về hướng xử trí phù hợp tiếp theo, em nhé.',
'Hình minh họa.\r\nNguồn Internet Chào bạn, Nếu như đã có\r\ný định đi thì bạn nên đến các phòng khám có bác sĩ chuyên khoa Da liễu để\r\nđược tư vấn cụ thể hơn về vấn đề chăm sóc da và điều trị dứt điểm mụn bạn nhé.\r\nTránh việc đến các cơ sở không uy tín dễ để lại di chứng sẹo xấu cho da mặt. Thân mến! AloBacsi.com Cổng thông tin tư vấn sức khỏe miễn phí',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# 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.*
-->
dev-eval| Metric | Value |
|---|---|
| map | 0.9982 |
| mrr@1 | 0.9964 |
| ndcg@1 | 0.9964 |
| query | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details | <ul><li>min: 6 tokens</li><li>mean: 66.63 tokens</li><li>max: 128 tokens</li></ul> | <ul><li>min: 32 tokens</li><li>mean: 120.11 tokens</li><li>max: 128 tokens</li></ul> | <ul><li>min: 31 tokens</li><li>mean: 119.58 tokens</li><li>max: 128 tokens</li></ul> |
| query | positive | negative |
|---|---|---|
| <code>Chào bác sĩ, |
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
| query | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details | <ul><li>min: 5 tokens</li><li>mean: 65.65 tokens</li><li>max: 128 tokens</li></ul> | <ul><li>min: 41 tokens</li><li>mean: 119.4 tokens</li><li>max: 128 tokens</li></ul> | <ul><li>min: 31 tokens</li><li>mean: 119.51 tokens</li><li>max: 128 tokens</li></ul> |
| query | positive | negative |
|---|---|---|
| <code>Thuốc Esseil-10 Davipharm điều trị tăng huyết áp (10 vỉ x 10 viên)</code> | <code>Mô tả ngắn:<br>Thuốc Esseil-10 là sản phẩm được sản xuất bởi Công ty Cổ phần Dược phẩm Đạt Vi Phú. Thuốc có thành phần chính là cilnidipin, được chỉ định để điều trị tăng huyết áp. <br> Thuốc Esseil-10 được bào chế dưới dạng viên nén tròn, bao phim màu vàng, một mặt có dập logo, mặt kia có dập gạch ngang và được đóng gói theo quy cách hộp 10 vỉ x 10 viên.<br>Thành phần:<br>Cilnidipine: 10mg<br>Chỉ định:<br>Thuốc Esseil-10 được chỉ định dùng trong các trường hợp sau: Cilnidipin được chỉ định để điều trị tăng huyết áp.</code> | <code>Mô tả ngắn:<br>Thuốc Althax là sản phẩm của Mediplantex chứa hoạt chất Thymomodulin có tác dụng hỗ trợ dự phòng tái phát nhiễm khuẩn hô hấp ở trẻ em và người lớn; viêm mũi dị ứng, dự phòng tái phát dị ứng thức ăn; cải thiện các triệu chứng lâm sàng ở bệnh nhân HIV/AIDS và tăng cường hệ miễn dịch đã suy giảm ở người cao tuổi.<br>Thành phần:<br>Thymomodulin: 120mg<br>Chỉ định:<br>Thuốc Althax được chỉ định dùng trong các trường hợp sau:<br>Hỗ trợ dự phòng tái phát nhiễm khuẩn hô hấp ở trẻ em và người lớn. Hỗ trợ điều trị viêm mũi dị ứng , dự phòng tái phát dị ứng thức ăn. Hỗ trợ cải thiện các triệu chứng lâm sàng ở bệnh nhân HIV/AIDS . Hỗ trợ tăng cường hệ miễn dịch đã suy giảm ở người cao tuổi.</code> |
| <code>Thưa BS, |
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
eval_strategy: stepsper_device_train_batch_size: 16per_device_eval_batch_size: 16learning_rate: 2e-05num_train_epochs: 5warmup_ratio: 0.1fp16: Truebatch_sampler: no_duplicatesoverwrite_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: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 5max_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: Falsehub_always_push: Falsegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseeval_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: Falsebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportional| Epoch | Step | Training Loss | Validation Loss | dev-eval_map |
|---|---|---|---|---|
| 0 | 0 | - | - | 0.9784 |
| 0.0372 | 100 | 1.102 | - | - |
| 0.0744 | 200 | 0.7679 | - | - |
| 0.1116 | 300 | 0.5825 | - | - |
| 0.1488 | 400 | 0.5424 | - | - |
| 0.1860 | 500 | 0.5088 | - | - |
| 0.2232 | 600 | 0.4052 | - | - |
| 0.2604 | 700 | 0.4012 | - | - |
| 0.2976 | 800 | 0.3834 | - | - |
| 0.3348 | 900 | 0.3688 | - | - |
| 0.3720 | 1000 | 0.3395 | 0.3014 | 0.9954 |
| 0.4092 | 1100 | 0.3401 | - | - |
| 0.4464 | 1200 | 0.3096 | - | - |
| 0.4836 | 1300 | 0.3438 | - | - |
| 0.5208 | 1400 | 0.2635 | - | - |
| 0.5580 | 1500 | 0.3225 | - | - |
| 0.5952 | 1600 | 0.3069 | - | - |
| 0.6324 | 1700 | 0.2943 | - | - |
| 0.6696 | 1800 | 0.2819 | - | - |
| 0.7068 | 1900 | 0.2679 | - | - |
| 0.7440 | 2000 | 0.2646 | 0.2357 | 0.9964 |
| 0.7812 | 2100 | 0.2487 | - | - |
| 0.8185 | 2200 | 0.2254 | - | - |
| 0.8557 | 2300 | 0.2623 | - | - |
| 0.8929 | 2400 | 0.2399 | - | - |
| 0.9301 | 2500 | 0.2206 | - | - |
| 0.9673 | 2600 | 0.2299 | - | - |
| 1.0045 | 2700 | 0.2218 | - | - |
| 1.0417 | 2800 | 0.2163 | - | - |
| 1.0789 | 2900 | 0.206 | - | - |
| 1.1161 | 3000 | 0.2099 | 0.1937 | 0.9976 |
| 1.1533 | 3100 | 0.2116 | - | - |
| 1.1905 | 3200 | 0.2027 | - | - |
| 1.2277 | 3300 | 0.1779 | - | - |
| 1.2649 | 3400 | 0.1686 | - | - |
| 1.3021 | 3500 | 0.1675 | - | - |
| 1.3393 | 3600 | 0.1487 | - | - |
| 1.3765 | 3700 | 0.141 | - | - |
| 1.4137 | 3800 | 0.1363 | - | - |
| 1.4509 | 3900 | 0.133 | - | - |
| 1.4881 | 4000 | 0.1357 | 0.1823 | 0.9977 |
| 1.5253 | 4100 | 0.1008 | - | - |
| 1.5625 | 4200 | 0.1249 | - | - |
| 1.5997 | 4300 | 0.1258 | - | - |
| 1.6369 | 4400 | 0.121 | - | - |
| 1.6741 | 4500 | 0.108 | - | - |
| 1.7113 | 4600 | 0.112 | - | - |
| 1.7485 | 4700 | 0.0988 | - | - |
| 1.7857 | 4800 | 0.0998 | - | - |
| 1.8229 | 4900 | 0.1031 | - | - |
| 1.8601 | 5000 | 0.1097 | 0.1697 | 0.9981 |
| 1.8973 | 5100 | 0.1025 | - | - |
| 1.9345 | 5200 | 0.0877 | - | - |
| 1.9717 | 5300 | 0.101 | - | - |
| 2.0089 | 5400 | 0.0963 | - | - |
| 2.0461 | 5500 | 0.083 | - | - |
| 2.0833 | 5600 | 0.0842 | - | - |
| 2.1205 | 5700 | 0.0861 | - | - |
| 2.1577 | 5800 | 0.0999 | - | - |
| 2.1949 | 5900 | 0.0972 | - | - |
| 2.2321 | 6000 | 0.0859 | 0.1635 | 0.998 |
| 2.2693 | 6100 | 0.0769 | - | - |
| 2.3065 | 6200 | 0.0778 | - | - |
| 2.3438 | 6300 | 0.0684 | - | - |
| 2.3810 | 6400 | 0.0623 | - | - |
| 2.4182 | 6500 | 0.0636 | - | - |
| 2.4554 | 6600 | 0.0647 | - | - |
| 2.4926 | 6700 | 0.0586 | - | - |
| 2.5298 | 6800 | 0.0464 | - | - |
| 2.5670 | 6900 | 0.0587 | - | - |
| 2.6042 | 7000 | 0.0617 | 0.1560 | 0.9984 |
| 2.6414 | 7100 | 0.0618 | - | - |
| 2.6786 | 7200 | 0.0453 | - | - |
| 2.7158 | 7300 | 0.0687 | - | - |
| 2.7530 | 7400 | 0.0434 | - | - |
| 2.7902 | 7500 | 0.0447 | - | - |
| 2.8274 | 7600 | 0.0508 | - | - |
| 2.8646 | 7700 | 0.0554 | - | - |
| 2.9018 | 7800 | 0.0459 | - | - |
| 2.9390 | 7900 | 0.0478 | - | - |
| 2.9762 | 8000 | 0.0449 | 0.1494 | 0.9981 |
| 3.0134 | 8100 | 0.0505 | - | - |
| 3.0506 | 8200 | 0.0484 | - | - |
| 3.0878 | 8300 | 0.0382 | - | - |
| 3.125 | 8400 | 0.0496 | - | - |
| 3.1622 | 8500 | 0.0513 | - | - |
| 3.1994 | 8600 | 0.051 | - | - |
| 3.2366 | 8700 | 0.0474 | - | - |
| 3.2738 | 8800 | 0.0382 | - | - |
| 3.3110 | 8900 | 0.0412 | - | - |
| 3.3482 | 9000 | 0.0294 | 0.1493 | 0.9983 |
| 3.3854 | 9100 | 0.0325 | - | - |
| 3.4226 | 9200 | 0.036 | - | - |
| 3.4598 | 9300 | 0.0371 | - | - |
| 3.4970 | 9400 | 0.0357 | - | - |
| 3.5342 | 9500 | 0.0285 | - | - |
| 3.5714 | 9600 | 0.0289 | - | - |
| 3.6086 | 9700 | 0.0331 | - | - |
| 3.6458 | 9800 | 0.0378 | - | - |
| 3.6830 | 9900 | 0.0249 | - | - |
| 3.7202 | 10000 | 0.0402 | 0.1478 | 0.9981 |
| 3.7574 | 10100 | 0.0298 | - | - |
| 3.7946 | 10200 | 0.0281 | - | - |
| 3.8318 | 10300 | 0.0271 | - | - |
| 3.8690 | 10400 | 0.0301 | - | - |
| 3.9062 | 10500 | 0.0274 | - | - |
| 3.9435 | 10600 | 0.023 | - | - |
| 3.9807 | 10700 | 0.0239 | - | - |
| 4.0179 | 10800 | 0.0259 | - | - |
| 4.0551 | 10900 | 0.0294 | - | - |
| 4.0923 | 11000 | 0.0233 | 0.1483 | 0.9983 |
| 4.1295 | 11100 | 0.033 | - | - |
| 4.1667 | 11200 | 0.0337 | - | - |
| 4.2039 | 11300 | 0.027 | - | - |
| 4.2411 | 11400 | 0.0262 | - | - |
| 4.2783 | 11500 | 0.0243 | - | - |
| 4.3155 | 11600 | 0.028 | - | - |
| 4.3527 | 11700 | 0.019 | - | - |
| 4.3899 | 11800 | 0.0187 | - | - |
| 4.4271 | 11900 | 0.0222 | - | - |
| 4.4643 | 12000 | 0.0227 | 0.1416 | 0.9981 |
| 4.5015 | 12100 | 0.0213 | - | - |
| 4.5387 | 12200 | 0.0183 | - | - |
| 4.5759 | 12300 | 0.0223 | - | - |
| 4.6131 | 12400 | 0.0205 | - | - |
| 4.6503 | 12500 | 0.0229 | - | - |
| 4.6875 | 12600 | 0.0172 | - | - |
| 4.7247 | 12700 | 0.0272 | - | - |
| 4.7619 | 12800 | 0.0157 | - | - |
| 4.7991 | 12900 | 0.0161 | - | - |
| 4.8363 | 13000 | 0.015 | 0.1414 | 0.9982 |
| 4.8735 | 13100 | 0.0196 | - | - |
| 4.9107 | 13200 | 0.0179 | - | - |
| 4.9479 | 13300 | 0.0196 | - | - |
| 4.9851 | 13400 | 0.015 | - | - |
@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",
}
@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.*
-->