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 = [
    '교수회에서 출석인원 과반수의 찬성이 필요한 이유가 뭐야?',
    '제 77 조 (회의)\n교무회의는 재적인원 과반수의 출석과 출석인원 과반수의 찬성으로 의결한다.',
    '제 22 조 (보증인)\n대학 입학 전형에 따라 보증인을 둘 수 있으며, 보증인은 당해 학생의 보호자이어야 하며 부득이한 경우에는 재학 중 학비, 기타 신상에 관한 일체의 책임을 질 수 있는 자로 한다.\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.35 tokens
    • max: 29 tokens
    • min: 18 tokens
    • mean: 104.74 tokens
    • max: 566 tokens
    • min: 0.0
    • mean: 0.09
    • max: 1.0
  • Samples:
    sentence_0 sentence_1 label
    한동대학교 교무회의는 어떻게 의결되나요? 제 13 조 (입학전형)
    입학전형은 당해연도 한국대학교육협의회의 대학입학전형기본사항, 이 대학교의 대학입학전형시행계획과 모집요강에 따라 선발한다.
    입학전형의 전형요소와 일정등 상세한 사항은 총장이 따로 정한다.
    입학전형을 시행함에 있어 입학사정관제로 학생을 선발할 수 있으며, 입학사정관제의 운영에 관한 세부사항은 총장이 따로 정한다.
    0.0
    한동대학교 교수회는 누가 소집하나요? 제 26 조 (복학)
    복학의 절차 및 시기 등에 관하여는 학사운영규정으로 정한다.
    제25조 제5항에 의거 미등록휴학된 자는 다음학기 제1항의 절차에 따라 복학하거나 휴학하여야 한다.
    0.0
    간행물을 발간, 배포 및 게시할 때 규정은 무엇인가요? 제 7 조 (학년도 및 학기)
    학년도는 3월 1일부터 다음해 2월말일까지로 한다.
    학년도는 다음과 같이 두 학기로 나누는 것을 원칙으로 한다.
    다만, 수업은 2주를 초과하지 않는 범위내에서 학기 개시일 전에 개강할 수 있다.
    제1학기 : 3월 1일부터 8월 31일까지.
    제2학기 : 9월 1일부터 다음해 2월 말일까지.
    하기 및 동기 방학기간 중에 1개 이상의 계절학기를 둘 수 있으며, 계절학기 운영에 관한 사항은 총장이 따로 정한다.
    정규학기 중 학생들이 자기주도적 학습활동을 할 수 있는 자유학기를 둘 수 있으며, 자유학기 운영에 관한 사항은 총장이 따로 정한다.
    정규학기 및 계절학기 중 학생들이 진로적성 탐색에 집중하거나 문제발굴과 해결을 위한 참여적 학습활동 위주의 혁신학기를 둘 수 있으며, 혁신학기 운영에 관한 사항은 총장이 따로 정한다.
    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: 10
  • 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: 10
  • 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

Epoch Step Training Loss
0.5537 500 0.004
1.0 903 -
1.1074 1000 0.0021
1.6611 1500 0.0017
2.0 1806 -
2.2148 2000 0.0013
2.7685 2500 0.0008
3.0 2709 -
3.3223 3000 0.0007
3.8760 3500 0.0005
4.0 3612 -
4.4297 4000 0.0003
4.9834 4500 0.0004
5.0 4515 -
5.5371 5000 0.0002
6.0 5418 -
6.0908 5500 0.0002
6.6445 6000 0.0002
7.0 6321 -
7.1982 6500 0.0001
7.7519 7000 0.0001
8.0 7224 -
8.3056 7500 0.0001
8.8594 8000 0.0001

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
3
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_10_0.3_1e-05

Base model

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