SentenceTransformer based on nlpai-lab/KURE-v1

This is a sentence-transformers model finetuned from nlpai-lab/KURE-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.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: nlpai-lab/KURE-v1
  • Maximum Sequence Length: 1024 tokens
  • Output Dimensionality: 1024 dimensions
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 1024, '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()
)

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("sentence_transformers_model_id")
# Run inference
sentences = [
    '한동대학교의 입학 지원절차는 어디에서 확인할 수 있나요?',
    '제 44 조 (학사경고)\n매학기 평점평균 2.0미만인 자에게 학사경고를 과하되, 본인 및 보증인, 소속 학과(부)장에게 즉시 통보한다.\n다만, 직전학기까지의 취득학점이 110학점 이상이고 등록학기 8학기 이상의 학생은 제외한다.\n제1항의 학생에게는 수강신청 학점을 제한 할 수 있으며, 이에 관한 세부사항은 총장이 따로 정한다.',
    '제 55 조 (학생지도위원회)\n학생자치 활동을 비롯한 학생들의 생활전반에 관한 사항을 지도, 협의하기 위하여 학생지도위원회를 둔다.\n학생지도위원회는 위원장 1인을 포함한 11인 이내의 위원으로 구성하되, 학생인재개발처장을 위원장으로 하고 교목실장, RC학장은 당 연직위원이 되며 그외 위원은 전임교원중에서 총장이 임명한다.\n학생지도위원회의 운영에 관하여 필요한 사항은 총장이 따로 정한다.',
]
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]

Training Details

Training Dataset

Unnamed Dataset

  • Size: 3,609 training samples
  • Columns: sentence_0, sentence_1, and label
  • Approximate statistics based on the first 1000 samples:
    sentence_0 sentence_1 label
    type string string float
    details
    • min: 9 tokens
    • mean: 17.29 tokens
    • max: 29 tokens
    • min: 18 tokens
    • mean: 108.36 tokens
    • max: 566 tokens
    • min: 0.0
    • mean: 0.08
    • max: 1.0
  • Samples:
    sentence_0 sentence_1 label
    한동대학교 교무회의에서 심의하는 주요 사항은 무엇인가요? 제 52 조 (총학생회)
    건전한 학풍을 조성하고 학생자치활동을 신장시키기 위하여 한동대학교 총학생회(이하 "총학생회"라 한다)를 둔다.
    총학생회의 조직과 운영에 관한 사항은 총장의 승인을 얻어 학생회칙으로 따로 정한다.
    전시·사변 또는 이에 준하는 국가 비상사태시에는 그 활동이 정지된다.
    0.0
    한동대학교에서 이수한 교과목의 취득학점을 철회할 수 있나요? 제 43 조 (수강과목 철회 및 재이수)
    수강신청한 과목을 철회할 수 있으며, 이에 관한 세부사항은 학사운영규정으로 정한다.
    이미 이수한 과목을 재이수하고자 할 때는 재이수 신청을 하여 이미 취득한 학점을 취소하고 재이수할 수 있다.
    재이수는 성적이 "C+"이하인 과목에 한하여 허용한다. 다만, 총장이 특별히 필요하다고 인정하는 경우에는 그러하지 아니하다.
    0.0
    한동대학교 교수회는 대학 운영의 중요한 사항도 심의하나요? 제 64 조 (휴학자의 납입금)
    휴학자에 대하여는 다음 학기 이후의 휴학기간중의 납입금을 면제 한다.
    다만, 당해학기 개강일전에 휴학한 자는 그 학기부터 면제한다.
    납입금을 납입하고 당해학기 휴학한 자의 납입금은 휴학시점에 따라 복학시 등록금을 차등 면제한다.
    이때 면제 등록금에 대하여는 증액된 납입금을 징수하지 아니한다.
    제2항의 휴학시점에 따라 복학시 등록금을 차등 면제하는 기준은 학사운영규정으로 정한다.
    0.0
  • Loss: ContrastiveLoss with these parameters:
    {
        "distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE",
        "margin": 0.3,
        "size_average": true
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 2
  • per_device_eval_batch_size: 2
  • num_train_epochs: 7
  • fp16: True
  • multi_dataset_batch_sampler: round_robin

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 2
  • per_device_eval_batch_size: 2
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 5e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1
  • num_train_epochs: 7
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.0
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: False
  • fp16: True
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: False
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • dispatch_batches: None
  • split_batches: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin

Training Logs

Click to expand
Epoch Step Training Loss
0.0554 50 -
0.1107 100 -
0.1661 150 -
0.2215 200 -
0.2769 250 -
0.3322 300 -
0.3876 350 -
0.4430 400 -
0.4983 450 -
0.5537 500 0.0036
0.6091 550 -
0.6645 600 -
0.7198 650 -
0.7752 700 -
0.8306 750 -
0.8859 800 -
0.9413 850 -
0.9967 900 -
1.0 903 -
1.0520 950 -
1.1074 1000 0.0019
1.1628 1050 -
1.2182 1100 -
1.2735 1150 -
1.3289 1200 -
1.3843 1250 -
1.4396 1300 -
1.4950 1350 -
1.5504 1400 -
1.6058 1450 -
1.6611 1500 0.0016
1.7165 1550 -
1.7719 1600 -
1.8272 1650 -
1.8826 1700 -
1.9380 1750 -
1.9934 1800 -
2.0 1806 -
2.0487 1850 -
2.1041 1900 -
2.1595 1950 -
2.2148 2000 0.0011
2.2702 2050 -
2.3256 2100 -
2.3810 2150 -
2.4363 2200 -
2.4917 2250 -
2.5471 2300 -
2.6024 2350 -
2.6578 2400 -
2.7132 2450 -
2.7685 2500 0.0008
2.8239 2550 -
2.8793 2600 -
2.9347 2650 -
2.9900 2700 -
3.0 2709 -
3.0454 2750 -
3.1008 2800 -
3.1561 2850 -
3.2115 2900 -
3.2669 2950 -
3.3223 3000 0.0007
3.3776 3050 -
3.4330 3100 -
3.4884 3150 -
3.5437 3200 -
3.5991 3250 -
3.6545 3300 -
3.7099 3350 -
3.7652 3400 -
3.8206 3450 -
3.8760 3500 0.0005
3.9313 3550 -
3.9867 3600 -
4.0 3612 -
4.0421 3650 -
4.0975 3700 -
4.1528 3750 -
4.2082 3800 -
4.2636 3850 -
4.3189 3900 -
4.3743 3950 -
4.4297 4000 0.0004
4.4850 4050 -
4.5404 4100 -
4.5958 4150 -
4.6512 4200 -
4.7065 4250 -
4.7619 4300 -
4.8173 4350 -
4.8726 4400 -
4.9280 4450 -
4.9834 4500 0.0002
5.0 4515 -
5.0388 4550 -
5.0941 4600 -
5.1495 4650 -
5.2049 4700 -
5.2602 4750 -
5.3156 4800 -
5.3710 4850 -
5.4264 4900 -
5.4817 4950 -
5.5371 5000 0.0003
5.5925 5050 -
5.6478 5100 -
5.7032 5150 -
5.7586 5200 -
5.8140 5250 -
5.8693 5300 -
5.9247 5350 -
5.9801 5400 -
6.0 5418 -
6.0354 5450 -
6.0908 5500 0.0002
6.1462 5550 -
6.2016 5600 -
6.2569 5650 -
6.3123 5700 -
6.3677 5750 -
6.4230 5800 -
6.4784 5850 -
6.5338 5900 -
6.5891 5950 -
6.6445 6000 0.0002
6.6999 6050 -
6.7553 6100 -
6.8106 6150 -
6.8660 6200 -
6.9214 6250 -
6.9767 6300 -

Framework Versions

  • Python: 3.10.13
  • Sentence Transformers: 3.3.1
  • Transformers: 4.46.2
  • PyTorch: 2.0.1+cu118
  • Accelerate: 0.34.2
  • Datasets: 3.0.0
  • Tokenizers: 0.20.1

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",
}

ContrastiveLoss

@inproceedings{hadsell2006dimensionality,
    author={Hadsell, R. and Chopra, S. and LeCun, Y.},
    booktitle={2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06)},
    title={Dimensionality Reduction by Learning an Invariant Mapping},
    year={2006},
    volume={2},
    number={},
    pages={1735-1742},
    doi={10.1109/CVPR.2006.100}
}
Downloads last month
17
Safetensors
Model size
568M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for TARARARAK/HGU_rulebook-fine-tuned-Kure-v1_ContrastiveLoss

Base model

BAAI/bge-m3
Finetuned
nlpai-lab/KURE-v1
Finetuned
(10)
this model