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 = [
    '학생지도위원회의 운영에 관한 사항은 누가 정하나요?',
    '제 13 조 (입학전형)\n입학전형은 당해연도 한국대학교육협의회의 대학입학전형기본사항, 이 대학교의 대학입학전형시행계획과 모집요강에 따라 선발한다.\n입학전형의 전형요소와 일정등 상세한 사항은 총장이 따로 정한다.\n입학전형을 시행함에 있어 입학사정관제로 학생을 선발할 수 있으며, 입학사정관제의 운영에 관한 세부사항은 총장이 따로 정한다.',
    '제 68 조 (기능)\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.16 tokens
    • max: 29 tokens
    • min: 18 tokens
    • mean: 109.48 tokens
    • max: 566 tokens
    • min: 0.0
    • mean: 0.09
    • max: 1.0
  • Samples:
    sentence_0 sentence_1 label
    원격수업을 통해서도 학점을 받을 수 있어? 제 48 조 (학년수료증)
    해당학년까지 소정의 등록과 학점을 취득한 때에는 별지 제2호 서식의 학년수료증을 수여할 수 있다.
    0.0
    한동대학교 학부에는 몇 개의 전공을 둘 수 있나요? 제 46 조 (학위수여)
    졸업자에게는 다음 각호와 같은 학위를 수여한다.
    문학사 : 국제어문학부 영어전공, 커뮤니케이션학부, 상담심리사회복지학부, 창의융합교육원 글로벌한국학(한국어교육)전공, 글로벌한국학(한국언어문화)전공.
    경영학사 : 경영경제학부 경영학전공, Global Management 전공.
    경제학사 : 경영경제학부 경제학전공.
    법학사 : 법학부.
    정치학사 : 국제어문학부 국제지역학전공.
    공학사 : 기계제어공학부, 공간환경시스템공학부, 콘텐츠융합디자인학부 제품디자인전공, ICT창업학부, 전산전자공학부 Information Technology 전공, 컴퓨터공학 전공, 전자공학 전공, AI융합교육원 AI융합전공.
    미술학사 : 콘텐츠융합디자인학부 시각디자인전공.
    이학사 : 생명과학부, 창의융합교육원 수학통계전공, AI융합전공 데이터사이언스전공.
    창의융합교육원 학생설계융합전공과 글로벌융합전공의 졸업요건을 모두 충족하였을 때에는 학생이 이 대학 학위수여 범위 안에서 자율적으로 신청 한 학위를 관련위원회의 심의를 거쳐 수여한다.
    공학사(전자공학심화) : 전산전자공학부 전자공학심화 전공.
    공학사(AI·컴퓨터공학심화) : 전산전자공학부 AI·컴퓨터공학심화 전공.
    모듈형설계전공의 학위수여는 총장이 따로 정한다.
    외국대학과의 협약에 의하여 이 대학교의 교육과정을 외국대학과 공동으로 운영할 수 있으며, 이를 이수한 학생에게 학위를 수여할 수 있다.
    협약 학생의 선발, 학사관리, 졸업요건 및 학위수여 등에 관한 세부사항은 총장이 따로 정한다.
    0.0
    천재지변이 일어나면 수업일수를 줄일 수 있어? 제 5 조 (수업년한 및 조기졸업)
    수업년한은 4년으로 한다.
    소정의 졸업학점을 취득하고 이 학칙이 정하는 졸업요건을 충족한 자로서 이수한 전 교과목의 평점평균이 4.0 이상인 자에 대하여는 수업년한을 3년내지 3년 6개월로 단축하여 조기졸업 시킬 수 있다.
    0.0
  • Loss: ContrastiveLoss with these parameters:
    {
        "distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE",
        "margin": 0.4,
        "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.0053
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.0034
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.0028
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.0019
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.0014
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.0011
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.0009
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.0007
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.0007
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.0004
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 -

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
4
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-article_ContrastiveLoss_7_0.4_1e-05

Base model

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