Downloads · 30 days
78
17% of all-time downloads
comet24082002/ft_bge_newLaw_CachedMultipleNegativeRankingLoss_SimSCE_V1_5epochs
ft_bge_newLaw_CachedMultipleNegativeRankingLoss_SimSCE_V1_5epochs is a sentence similarity model from comet24082002. 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 comet24082002/finetunebgesimsceV1. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic…
Downloads · 30 days
78
17% of all-time downloads
All-time downloads
460
Public
Parameters
568M
2.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.3 GB · 99%
From the Hugging Face model README
This is a sentence-transformers model finetuned from comet24082002/finetune_bge_simsce_V1. It maps sentences & paragraphs to a 1024-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': 512, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
(1): Pooling({'word_embedding_dimension': 1024, '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()
)
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("comet24082002/ft_bge_newLaw_CachedMultipleNegativeRankingLoss_SimSCE_V1_5epochs")
# Run inference
sentences = [
'Các tổ chức nào được phép kinh doanh ngoại hối ở Việt Nam?',
'"Điều 2. Giải thích từ ngữ\nTại Thông tư này, các từ ngữ dưới đây được hiểu như sau:\n1. Tổ chức tín dụng được phép hoạt động ngoại hối là các ngân hàng, tổ chức tín dụng phi ngân hàng và chi nhánh ngân hàng nước ngoài được kinh doanh, cung ứng dịch vụ ngoại hối (sau đây gọi là tổ chức tín dụng được phép).\n..."',
'"Điều 24. Mục đích sử dụng các quỹ\n...\n2. Mục đích sử dụng Quỹ:\n...\ne) Quỹ phúc lợi tập trung được trích lập từ lợi nhuận sau thuế của Công ty mẹ và nguồn đóng góp khác (nếu có). Quỹ phúc lợi được dùng để:\n- Đầu tư xây dựng hoặc sửa chữa các công trình phúc lợi của Công ty mẹ;\n- Chi cho các hoạt động phúc lợi của người lao động trong Công ty mẹ bao gồm cả người quản lý, kiểm soát viên của Công ty mẹ làm việc theo hợp đồng lao động và người quản lý, kiểm soát viên của Công ty mẹ do nhà nước bổ nhiệm;\n- Góp một phần vốn để đầu tư xây dựng các công trình phúc lợi chung trong ngành hoặc với các đơn vị khác theo hợp đồng;\n- Sử dụng một phần quỹ phúc lợi để trợ cấp khó khăn đột xuất cho những người lao động kể cả những trường hợp về hưu, về mất sức, lâm vào hoàn cảnh khó khăn, không nơi nương tựa hoặc làm công tác từ thiện xã hội;\n- Mức chi sử dụng quỹ do Tổng giám đốc Công ty mẹ quyết định được ghi trong quy chế quản lý, sử dụng quỹ của Công ty mẹ."',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]
# 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.*
-->
<!--
## 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.*
-->
| anchor | positive | |
|---|---|---|
| type | string | string |
| details | <ul><li>min: 8 tokens</li><li>mean: 24.54 tokens</li><li>max: 47 tokens</li></ul> | <ul><li>min: 16 tokens</li><li>mean: 267.58 tokens</li><li>max: 512 tokens</li></ul> |
| anchor | positive |
|---|---|
| <code>Hội viên Hội Văn nghệ dân gian Việt Nam có những quyền hạn gì?</code> | <code>Quyền của hội viên<br>1. Được cấp thẻ hội viên, được Hội giúp đỡ thực hiện các hoạt động sưu tầm, nghiên cứu văn hóa văn nghệ dân gian hợp pháp, được tham dự các giải thưởng hằng năm của Hội theo quy định của Điều lệ hội và quy định của pháp luật.<br>2. Được tham gia thảo luận, quyết định các chủ trương công tác của Hội theo quy định của Hội; được tham dự Đại hội, ứng cử, đề cử, bầu cử vào các cơ quan lãnh đạo và Ban Kiểm tra Hội theo quy định của Hội; được giới thiệu hội viên mới.<br>3. Được Hội bảo vệ quyền, lợi ích hợp pháp theo quy định của pháp luật, được hưởng các quyền lợi vật chất, tinh thần theo Quy chế về tổ chức và hoạt động của Hội. Được Hội cung cấp thông tin liên quan đến lĩnh vực hoạt động của Hội, được tham gia các hoạt động do Hội tổ chức.<br>4. Có quyền phê bình, chất vấn các cá nhân lãnh đạo và các cơ quan, tổ chức chuyên môn của Hội và yêu cầu được trả lời những nội dung liên quan đến tổ chức, hoạt động của Hội theo quy định của Điều lệ Hội.<br>5. Có quyền đề nghị bằng văn bản được ngừng sinh hoạt Hội theo quy định của Hội.<br>6. Được khen thưởng theo quy định của Hội.<br>7. Được ra khỏi Hội khi xét thấy không thể tiếp tục tham gia sinh hoạt Hội.</code> |
| <code>Giáo viên muốn xét thăng hạng giáo viên trung học cơ sở hạng I có cần được cấp chứng chỉ bồi dưỡng hay không?</code> | <code>Giáo viên trung học cơ sở hạng I - Mã số V.07.04.30<br>...<br>3. Tiêu chuẩn về trình độ đào tạo, bồi dưỡng<br>a) Có bằng thạc sĩ trở lên thuộc ngành đào tạo giáo viên đối với giáo viên trung học cơ sở hoặc có bằng thạc sĩ trở lên chuyên ngành phù hợp với môn học giảng dạy hoặc có bằng thạc sĩ quản lý giáo dục trở lên;<br>b) Có chứng chỉ bồi dưỡng theo tiêu chuẩn chức danh nghề nghiệp giáo viên trung học cơ sở hạng I.</code> |
| <code>Trong kinh doanh vận tải hành khách bằng xe buýt theo tuyến cố định, nhân viên xe buýt không giúp đỡ hành khách đi xe là người khuyết tật sẽ bị xử phạt thế nào?</code> | <code>Xử phạt nhân viên phục vụ trên xe buýt, xe vận chuyển hành khách theo tuyến cố định, xe vận chuyển hành khách theo hợp đồng, xe vận chuyển khách du lịch vi phạm quy định về trật tự an toàn giao thông<br>1. Phạt tiền từ 80.000 đồng đến 100.000 đồng đối với một trong các hành vi vi phạm sau đây:<br>a) Không hỗ trợ, giúp đỡ hành khách đi xe là người cao tuổi, trẻ em không tự lên xuống xe được, người khuyết tật vận động hoặc khuyết tật thị giác;<br>...</code> |
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
per_device_train_batch_size: 256learning_rate: 2e-05num_train_epochs: 5warmup_ratio: 0.1overwrite_output_dir: Falsedo_predict: Falseeval_strategy: noprediction_loss_only: Trueper_device_train_batch_size: 256per_device_eval_batch_size: 8per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_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: Falsefp16_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: Falsebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportional| Epoch | Step | Training Loss |
|---|---|---|
| 0.0476 | 2 | 1.5732 |
| 0.0952 | 4 | 1.6162 |
| 0.1429 | 6 | 1.3108 |
| 0.1905 | 8 | 1.0944 |
| 0.2381 | 10 | 0.8889 |
| 0.2857 | 12 | 0.7499 |
| 0.3333 | 14 | 0.601 |
| 0.3810 | 16 | 0.565 |
| 0.4286 | 18 | 0.4791 |
| 0.4762 | 20 | 0.4314 |
| 0.5238 | 22 | 0.4619 |
| 0.5714 | 24 | 0.3768 |
| 0.6190 | 26 | 0.4344 |
| 0.6667 | 28 | 0.3748 |
| 0.7143 | 30 | 0.3172 |
| 0.7619 | 32 | 0.3971 |
| 0.8095 | 34 | 0.2847 |
| 0.8571 | 36 | 0.3426 |
| 0.9048 | 38 | 0.4206 |
| 0.9524 | 40 | 0.276 |
| 1.0 | 42 | 0.1399 |
| 1.0476 | 44 | 0.2204 |
| 1.0952 | 46 | 0.2922 |
| 1.1429 | 48 | 0.2728 |
| 1.1905 | 50 | 0.2355 |
| 1.2381 | 52 | 0.2075 |
| 1.2857 | 54 | 0.2285 |
| 1.3333 | 56 | 0.2303 |
| 1.3810 | 58 | 0.2122 |
| 1.4286 | 60 | 0.2553 |
| 1.4762 | 62 | 0.2361 |
| 1.5238 | 64 | 0.2407 |
| 1.5714 | 66 | 0.2206 |
| 1.6190 | 68 | 0.2375 |
| 1.6667 | 70 | 0.2509 |
| 1.7143 | 72 | 0.1977 |
| 1.7619 | 74 | 0.2391 |
| 1.8095 | 76 | 0.1676 |
| 1.8571 | 78 | 0.3073 |
| 1.9048 | 80 | 0.2181 |
| 1.9524 | 82 | 0.265 |
| 2.0 | 84 | 0.1474 |
| 2.0476 | 86 | 0.1838 |
| 2.0952 | 88 | 0.2052 |
| 2.1429 | 90 | 0.1581 |
| 2.1905 | 92 | 0.1753 |
| 2.2381 | 94 | 0.1829 |
| 2.2857 | 96 | 0.2051 |
| 2.3333 | 98 | 0.2081 |
| 2.3810 | 100 | 0.194 |
| 2.4286 | 102 | 0.1139 |
| 2.4762 | 104 | 0.2349 |
| 2.5238 | 106 | 0.1427 |
| 2.5714 | 108 | 0.1654 |
| 2.6190 | 110 | 0.187 |
| 2.6667 | 112 | 0.1615 |
| 2.7143 | 114 | 0.1933 |
| 2.7619 | 116 | 0.1608 |
| 2.8095 | 118 | 0.1548 |
| 2.8571 | 120 | 0.1659 |
| 2.9048 | 122 | 0.1498 |
| 2.9524 | 124 | 0.1927 |
| 3.0 | 126 | 0.0566 |
| 3.0476 | 128 | 0.1493 |
| 3.0952 | 130 | 0.1435 |
| 3.1429 | 132 | 0.157 |
| 3.1905 | 134 | 0.1999 |
| 3.2381 | 136 | 0.1026 |
| 3.2857 | 138 | 0.1718 |
| 3.3333 | 140 | 0.1603 |
| 3.3810 | 142 | 0.1537 |
| 3.4286 | 144 | 0.1709 |
| 3.4762 | 146 | 0.1661 |
| 3.5238 | 148 | 0.1389 |
| 3.5714 | 150 | 0.1447 |
| 3.6190 | 152 | 0.1482 |
| 3.6667 | 154 | 0.1344 |
| 3.7143 | 156 | 0.1348 |
| 3.7619 | 158 | 0.1271 |
| 3.8095 | 160 | 0.1549 |
| 3.8571 | 162 | 0.124 |
| 3.9048 | 164 | 0.1555 |
| 3.9524 | 166 | 0.1215 |
| 4.0 | 168 | 0.1073 |
| 4.0476 | 170 | 0.1432 |
| 4.0952 | 172 | 0.133 |
| 4.1429 | 174 | 0.1253 |
| 4.1905 | 176 | 0.1433 |
| 4.2381 | 178 | 0.1671 |
| 4.2857 | 180 | 0.0884 |
| 4.3333 | 182 | 0.1326 |
| 4.3810 | 184 | 0.1318 |
| 4.4286 | 186 | 0.1445 |
| 4.4762 | 188 | 0.1168 |
| 4.5238 | 190 | 0.1106 |
| 4.5714 | 192 | 0.1235 |
| 4.6190 | 194 | 0.1252 |
| 4.6667 | 196 | 0.1265 |
| 4.7143 | 198 | 0.1885 |
| 4.7619 | 200 | 0.1168 |
| 4.8095 | 202 | 0.1035 |
| 4.8571 | 204 | 0.1822 |
| 4.9048 | 206 | 0.1227 |
| 4.9524 | 208 | 0.1332 |
| 5.0 | 210 | 0.0698 |
@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{gao2021scaling,
title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
year={2021},
eprint={2101.06983},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
<!--
## 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.*
-->