Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: PeftModel
(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("trunghieu1206/2026_04_27_embed")
5# Run inference
6sentences = [
7 'Ngày 20/01/2020, Trần Th H gom rác thành một đống cao khoảng 0,5 mét, rộng khoảng 01 mét để dưới sàn nhà của bà Nguyễn Thị B L rồi bật lửa đốt nhưng không quan sát lửa đang cháy. Ngọn lửa sau đó bùng phát làm cháy nhà của bà L, bà Trương T N và bà Nguyễn Thị Q, gây thiệt hại về tài sản với tổng số tiền là 691.202.000 đồng.',
8 'Điều 180 - BLHS 2015 (sửa đổi 2017)',
9 'Điều 47 - BLHS 2015 (sửa đổi 2017)',
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]legal-valEmbeddingSimilarityEvaluator| Metric | Value |
|---|---|
| pearson_cosine | 0.5994 |
| spearman_cosine | 0.5978 |
anchor and positive| anchor | positive | |
|---|---|---|
| type | string | string |
| details |
|
|
| anchor | positive |
|---|---|
Khoảng 01 giờ ngày 16/10/2025, tại thôn 8, xã Ea Drăng, tỉnh Đắk Lắk, Nguyễn Thanh H và Phạm Trường V dùng vũ lực bắt chị Ngân Thị D đưa lên xe taxi về phòng trọ của Nguyễn Thanh H. Tại đây, Nguyễn Thanh H chỉ đạo Phạm Trường V và Y Bi M dùng xích và ổ khóa xích chân chị D vào khung cửa sổ phòng khách, sau đó tiếp tục quản lý chị D cho đến 17 giờ ngày 17/10/2025 mới cho về. | Điều 157 - BLHS 2015 (sửa đổi 2017) |
Bị cáo Đỗ Đức C gây tai nạn giao thông khiến ông Uông Sỹ H2 chết và cháu Ngô Trọng H1 bị thương 27%, nhưng bị cáo không có tiền án tiền sự, thành khẩn khai báo và tự nguyện bồi thường thiệt hại cho gia đình bị hại. | Điều 50 - BLHS 2015 (sửa đổi 2017) |
Vũ Việt H, Nguyễn Văn T, Đoàn Văn T và Vi Văn Phong cùng chuẩn bị ma túy (Ketamine, MDMA), địa điểm, dụng cụ sử dụng ma túy và tìm Bùi Thu Hà, Bùi Thanh Yên để cùng sử dụng trái phép chất ma túy. | Điều 255 - BLHS 2015 (sửa đổi 2017) |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim"
4}anchor and positive| anchor | positive | |
|---|---|---|
| type | string | string |
| details |
|
|
| anchor | positive |
|---|---|
Phạm Ngọc H và Nguyễn Hoàng N cùng góp tiền mua ma túy Methamphetamine, chia ra tàng trữ để sử dụng và bị cơ quan chức năng bắt quả tang vào ngày 20-7-2021. | Điều 17 - BLHS 2015 (sửa đổi 2017) |
Cơ quan chức năng thu giữ 03 gói tinh thể màu trắng là chất ma túy, 01 đôi dép quai kẹp màu nâu-đen, 01 điện thoại di động hiệu Nokia và 01 chiếc xe mô tô biển số 83P3-265.91. | Điều 47 - BLHS 2015 (sửa đổi 2017) |
Nguyễn Thanh L được bà Nguyễn Thị Bé T1 và ông Nguyễn Văn H tin tưởng nhờ thu tiền của 11 hộ nông dân với tổng số tiền là 443.000.000 đồng. Tuy nhiên, sau khi thu được tiền, L đã nói dối là chưa thu được và lấy toàn bộ số tiền này để tiêu xài và trả nợ cá nhân. | Điều 175 - BLHS 2015 (sửa đổi 2017) |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim"
4}eval_strategy: epochper_device_train_batch_size: 16per_device_eval_batch_size: 16learning_rate: 0.0002warmup_ratio: 0.1fp16: Truedataloader_num_workers: 2load_best_model_at_end: Trueoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: epochprediction_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: 0.0002weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 3max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_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: 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: 2dataloader_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}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_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: Falsehub_revision: Nonegradient_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: noneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Trueprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportional| Epoch | Step | Training Loss | Validation Loss | legal-val_spearman_cosine |
|---|---|---|---|---|
| 0.0637 | 10 | 3.5013 | - | - |
| 0.1274 | 20 | 3.4368 | - | - |
| 0.1911 | 30 | 3.2505 | - | - |
| 0.2548 | 40 | 2.9093 | - | - |
| 0.3185 | 50 | 2.8246 | - | - |
| 0.3822 | 60 | 2.686 | - | - |
| 0.4459 | 70 | 2.6094 | - | - |
| 0.5096 | 80 | 2.5076 | - | - |
| 0.5732 | 90 | 2.2877 | - | - |
| 0.6369 | 100 | 2.3017 | - | - |
| 0.7006 | 110 | 2.1231 | - | - |
| 0.7643 | 120 | 2.1033 | - | - |
| 0.8280 | 130 | 1.9611 | - | - |
| 0.8917 | 140 | 1.9276 | - | - |
| 0.9554 | 150 | 1.9975 | - | - |
| 1.0 | 157 | - | 1.7991 | 0.5097 |
| 1.0191 | 160 | 1.8427 | - | - |
| 1.0828 | 170 | 1.7367 | - | - |
| 1.1465 | 180 | 1.7569 | - | - |
| 1.2102 | 190 | 1.7362 | - | - |
| 1.2739 | 200 | 1.7676 | - | - |
| 1.3376 | 210 | 1.6147 | - | - |
| 1.4013 | 220 | 1.6692 | - | - |
| 1.4650 | 230 | 1.7377 | - | - |
| 1.5287 | 240 | 1.543 | - | - |
| 1.5924 | 250 | 1.5071 | - | - |
| 1.6561 | 260 | 1.5427 | - | - |
| 1.7197 | 270 | 1.6629 | - | - |
| 1.7834 | 280 | 1.559 | - | - |
| 1.8471 | 290 | 1.5447 | - | - |
| 1.9108 | 300 | 1.4666 | - | - |
| 1.9745 | 310 | 1.5717 | - | - |
| 2.0 | 314 | - | 1.5295 | 0.5852 |
| 2.0382 | 320 | 1.5082 | - | - |
| 2.1019 | 330 | 1.4965 | - | - |
| 2.1656 | 340 | 1.3942 | - | - |
| 2.2293 | 350 | 1.4891 | - | - |
| 2.2930 | 360 | 1.3653 | - | - |
| 2.3567 | 370 | 1.3084 | - | - |
| 2.4204 | 380 | 1.3594 | - | - |
| 2.4841 | 390 | 1.3322 | - | - |
| 2.5478 | 400 | 1.3797 | - | - |
| 2.6115 | 410 | 1.3486 | - | - |
| 2.6752 | 420 | 1.406 | - | - |
| 2.7389 | 430 | 1.4229 | - | - |
| 2.8025 | 440 | 1.3646 | - | - |
| 2.8662 | 450 | 1.2449 | - | - |
| 2.9299 | 460 | 1.3559 | - | - |
| 2.9936 | 470 | 1.397 | - | - |
| 3.0 | 471 | - | 1.4348 | 0.5978 |
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{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}