Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 8192, '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()
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("namnguyenba2003/Vietnamese_Law_Embedding_finetuned")
5# Run inference
6sentences = [
7 'Điều 9. Hồ sơ làm căn cứ để đánh giá đáp ứng GACP\n1. Đơn đề nghị đánh giá theo Mẫu số 1A Phụ lục I Thông tư này.\n2. Bản sao có xác nhận của đơn vị đối với Quyết định thành lập hoặc Giấy chứng nhận đăng ký kinh doanh hoặc Giấy phép đầu tư (đối với trường hợp quy định tại Điểm a Khoản 1 Điều 8 Thông tư này).\n3. Sơ đồ tổ chức và nhân sự của cơ sở (nêu rõ các bộ phận chủ chốt của cơ sở: họ tên, chức danh, trình độ chuyên môn và kinh nghiệm công tác của các trưởng bộ phận). Trường hợp cơ sở gồm nhiều hộ gia đình thì phải gửi kèm danh sách họ tên, địa chỉ, địa điểm, diện tích nuôi trồng, khai thác và hợp đồng thu mua giữa cơ sở với các hộ gia đình/đại diện các hộ gia đình.\n4. Sơ đồ phân lô khu vực nuôi trồng, khai thác và bản thuyết minh các khu vực nuôi trồng, khai thác, sơ chế, chế biến và bảo quản.\n5. Kế hoạch, nội dung và kết quả đào tạo về GACP cho nhân viên của cơ sở trong năm nộp hồ sơ.',
8 'Theo quy định, cơ sở nuôi trồng, khai thác dược liệu phải cung cấp những thông tin gì về tổ chức và nhân sự của cơ sở để được đánh giá đáp ứng GACP?',
9 'Nếu một đơn vị đã đưa tài sản cố định vào sử dụng nhưng chưa có quyết toán được phê duyệt, họ sẽ xác định nguyên giá tài sản như thế nào?',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 1024]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities.shape)
18# [3, 3]dim_1024InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 1024
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.7351 |
| cosine_accuracy@3 | 0.7786 |
| cosine_accuracy@5 | 0.8664 |
| cosine_accuracy@10 | 0.9293 |
| cosine_precision@1 | 0.7351 |
| cosine_precision@3 | 0.6866 |
| cosine_precision@5 | 0.484 |
| cosine_precision@10 | 0.2677 |
| cosine_recall@1 | 0.2735 |
| cosine_recall@3 | 0.7252 |
| cosine_recall@5 | 0.8354 |
| cosine_recall@10 | 0.9222 |
| cosine_ndcg@10 | 0.8336 |
| cosine_mrr@10 | 0.781 |
| cosine_map@100 | 0.8092 |
dim_768InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 768
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.7348 |
| cosine_accuracy@3 | 0.7755 |
| cosine_accuracy@5 | 0.866 |
| cosine_accuracy@10 | 0.9278 |
| cosine_precision@1 | 0.7348 |
| cosine_precision@3 | 0.6841 |
| cosine_precision@5 | 0.4834 |
| cosine_precision@10 | 0.2673 |
| cosine_recall@1 | 0.2739 |
| cosine_recall@3 | 0.723 |
| cosine_recall@5 | 0.8348 |
| cosine_recall@10 | 0.9212 |
| cosine_ndcg@10 | 0.8328 |
| cosine_mrr@10 | 0.7801 |
| cosine_map@100 | 0.8087 |
dim_512InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 512
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.725 |
| cosine_accuracy@3 | 0.7701 |
| cosine_accuracy@5 | 0.8598 |
| cosine_accuracy@10 | 0.927 |
| cosine_precision@1 | 0.725 |
| cosine_precision@3 | 0.6782 |
| cosine_precision@5 | 0.4795 |
| cosine_precision@10 | 0.2668 |
| cosine_recall@1 | 0.2696 |
| cosine_recall@3 | 0.7167 |
| cosine_recall@5 | 0.8281 |
| cosine_recall@10 | 0.919 |
| cosine_ndcg@10 | 0.827 |
| cosine_mrr@10 | 0.7724 |
| cosine_map@100 | 0.8016 |
dim_256InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 256
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.7177 |
| cosine_accuracy@3 | 0.7604 |
| cosine_accuracy@5 | 0.8505 |
| cosine_accuracy@10 | 0.9223 |
| cosine_precision@1 | 0.7177 |
| cosine_precision@3 | 0.6703 |
| cosine_precision@5 | 0.474 |
| cosine_precision@10 | 0.2658 |
| cosine_recall@1 | 0.2673 |
| cosine_recall@3 | 0.7086 |
| cosine_recall@5 | 0.8179 |
| cosine_recall@10 | 0.9152 |
| cosine_ndcg@10 | 0.8209 |
| cosine_mrr@10 | 0.765 |
| cosine_map@100 | 0.7947 |
dim_128InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 128
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.6901 |
| cosine_accuracy@3 | 0.732 |
| cosine_accuracy@5 | 0.8338 |
| cosine_accuracy@10 | 0.9095 |
| cosine_precision@1 | 0.6901 |
| cosine_precision@3 | 0.6427 |
| cosine_precision@5 | 0.4603 |
| cosine_precision@10 | 0.2608 |
| cosine_recall@1 | 0.2578 |
| cosine_recall@3 | 0.6807 |
| cosine_recall@5 | 0.7959 |
| cosine_recall@10 | 0.8988 |
| cosine_ndcg@10 | 0.7991 |
| cosine_mrr@10 | 0.7398 |
| cosine_map@100 | 0.7726 |
positive and anchor| positive | anchor | |
|---|---|---|
| type | string | string |
| details |
|
|
| positive | anchor |
|---|---|
Điều 7. Cấp chứng chỉ[object Object]1. Người học được cơ sở đào tạo cấp Chứng chỉ đào tạo nghiệp vụ giám định pháp y hoặc giám định pháp y tâm thần khi đáp ứng đủ các yêu cầu sau đây:[object Object]a) Không vi phạm các quy định của khóa đào tạo;[object Object]b) Tham gia đầy đủ thời gian đào tạo và tích lũy đủ nội dung của chương trình đào tạo;[object Object]c) Kết quả kiểm tra, đánh giá năng lực đạt yêu cầu của khóa đào tạo;[object Object]d) Hoàn thành đầy đủ các nghĩa vụ của người học đối với cơ sở đào tạo.[object Object]2. Mẫu Chứng chỉ đào tạo nghiệp vụ giám định pháp y hoặc nghiệp vụ giám định pháp y tâm thần được quy định tại Phụ lục ban hành kèm theo Thông tư này.[object Object]3. Chứng chỉ đào tạo nghiệp vụ giám định pháp y và đào tạo nghiệp vụ giám định pháp y tâm thần là một trong những điều kiện để bổ nhiệm giám định viên tư pháp trong lĩnh vực pháp y và pháp y tâm thần theo quy định của Luật giám định tư pháp. | Luật giám định tư pháp quy định những điều kiện gì để bổ nhiệm giám định viên tư pháp trong lĩnh vực pháp y và pháp y tâm thần? |
Điều 68. Nguyên tắc quản lý, sử dụng[object Object]1. Người làm công tác thi hành án dân sự phải mặc trang phục có gắn bảng tên, phù hiệu, cấp hiệu thi hành án dân sự tại công sở và trong khi thi hành công vụ theo đúng chức vụ, chức danh đang đảm nhiệm.[object Object]2. Việc cấp phát, quản lý, sử dụng trang phục, phù hiệu, cấp hiệu, Thẻ Chấp hành viên, Thẻ Thẩm tra viên thi hành án phải đúng mục đích, đúng đối tượng, đúng chế độ theo quy định của pháp luật.[object Object]3. Nghiêm cấm việc sử dụng trang phục, phù hiệu, cấp hiệu, Thẻ Chấp hành viên, Thẻ Thẩm tra viên thi hành án để thực hiện các hành vi trái pháp luật. | Việc sử dụng trang phục, phù hiệu, cấp hiệu, Thẻ Chấp hành viên, Thẻ Thẩm tra viên thi hành án để thực hiện các hành vi trái pháp luật bị nghiêm cấm như thế nào? |
Điều 8. Trách nhiệm của cơ sở cung cấp dịch vụ công tác xã hội[object Object]1. Thường xuyên tổ chức giáo dục ý thức tuân thủ các quy định về tiêu chuẩn đạo đức nghề nghiệp đối với người làm công tác xã hội thuộc phạm vi quản lý.[object Object]2. Phối hợp với các cơ sở đào tạo, cơ sở giáo dục nghề nghiệp để đào tạo, bồi dưỡng, nâng cao năng lực chuyên môn và đạo đức nghề nghiệp đối với người làm công tác xã hội.[object Object]3. Công bố công khai tiêu chuẩn đạo đức nghề công tác xã hội để người làm công tác xã hội biết và nghiêm túc thực hiện.[object Object]4. Tạo điều kiện thuận lợi và hỗ trợ để người làm công tác xã hội thực hiện tốt các tiêu chuẩn đạo đức nghề nghiệp trong quá trình thực hành công tác xã hội.[object Object]5. Tiếp nhận, giải quyết các khiếu nại, tố cáo của đối tượng liên quan đến việc thực hiện đạo đức nghề nghiệp của người làm công tác xã hội theo thẩm quyền; xử lý nghiêm các hành vi vi phạm đạo đức nghề nghiệp thuộc phạm vi quản lý theo quy định của pháp luật.[object Object]6. Thường xuyên kiểm tra, đánh giá kết quả việc thực hiện tiêu chuẩn đạo ... | Các cơ sở cung cấp dịch vụ công tác xã hội phải làm gì để đảm bảo người làm công tác xã hội tuân thủ đạo đức nghề nghiệp? |
MatryoshkaLoss with these parameters:
1{
2 "loss": "MultipleNegativesRankingLoss",
3 "matryoshka_dims": [
4 1024,
5 768,
6 512,
7 256,
8 128
9 ],
10 "matryoshka_weights": [
11 1,
12 1,
13 1,
14 1,
15 1
16 ],
17 "n_dims_per_step": -1
18}eval_strategy: epochper_device_train_batch_size: 64per_device_eval_batch_size: 64gradient_accumulation_steps: 8learning_rate: 3e-05num_train_epochs: 4lr_scheduler_type: cosinewarmup_ratio: 0.1fp16: Truetf32: Truedataloader_num_workers: 8load_best_model_at_end: Trueoptim: adamw_torch_fusedddp_find_unused_parameters: Falsebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: epochprediction_loss_only: Trueper_device_train_batch_size: 64per_device_eval_batch_size: 64per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 8eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 3e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 4max_steps: -1lr_scheduler_type: cosinelr_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: Truelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 8dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_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_torch_fusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Falseddp_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: 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: no_duplicatesmulti_dataset_batch_sampler: proportional| Epoch | Step | Training Loss | dim_1024_cosine_ndcg@10 | dim_768_cosine_ndcg@10 | dim_512_cosine_ndcg@10 | dim_256_cosine_ndcg@10 | dim_128_cosine_ndcg@10 |
|---|---|---|---|---|---|---|---|
| 0.2210 | 10 | 5.7308 | - | - | - | - | - |
| 0.4420 | 20 | 2.5237 | - | - | - | - | - |
| 0.6630 | 30 | 2.1593 | - | - | - | - | - |
| 0.8840 | 40 | 1.741 | - | - | - | - | - |
| 1.0 | 46 | - | 0.8236 | 0.8186 | 0.8173 | 0.8095 | 0.7822 |
| 1.0884 | 50 | 1.4595 | - | - | - | - | - |
| 1.3094 | 60 | 1.3117 | - | - | - | - | - |
| 1.5304 | 70 | 1.2627 | - | - | - | - | - |
| 1.7514 | 80 | 1.07 | - | - | - | - | - |
| 1.9724 | 90 | 1.03 | - | - | - | - | - |
| 2.0 | 92 | - | 0.8302 | 0.8300 | 0.8260 | 0.8177 | 0.7981 |
| 2.1768 | 100 | 0.8494 | - | - | - | - | - |
| 2.3978 | 110 | 1.0987 | - | - | - | - | - |
| 2.6188 | 120 | 0.8031 | - | - | - | - | - |
| 2.8398 | 130 | 0.8575 | - | - | - | - | - |
| 3.0 | 138 | - | 0.8323 | 0.8321 | 0.8259 | 0.8197 | 0.7984 |
| 3.0442 | 140 | 0.7405 | - | - | - | - | - |
| 3.2652 | 150 | 0.8546 | - | - | - | - | - |
| 3.4862 | 160 | 0.7658 | - | - | - | - | - |
| 3.7072 | 170 | 0.8311 | - | - | - | - | - |
| 3.9282 | 180 | 0.8719 | - | - | - | - | - |
| 4.0 | 184 | - | 0.8336 | 0.8328 | 0.827 | 0.8209 | 0.7991 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{kusupati2024matryoshka,
2 title={Matryoshka Representation Learning},
3 author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
4 year={2024},
5 eprint={2205.13147},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG}
8}1@misc{henderson2017efficient,
2 title={Efficient Natural Language Response Suggestion for Smart Reply},
3 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},
4 year={2017},
5 eprint={1705.00652},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}