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: 512 tokens
  • Output Dimensionality: 1024 dimensions
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, '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 = [
    '한동대학교의 학생지도위원회는 어떤 역할을 하나요? 위원회는 어떻게 구성되나요?',
    '제 55 조 (학생지도위원회)\n학생자치 활동을 비롯한 학생들의 생활전반에 관한 사항을 지도, 협의하기 위하여 학생지도위원회를 둔다.\n학생지도위원회는 위원장 1인을 포함한 11인 이내의 위원으로 구성하되, 학생인재개발처장을 위원장으로 하고 교목실장, RC학장은 당 연직위원이 되며 그외 위원은 전임교원중에서 총장이 임명한다.\n학생지도위원회의 운영에 관하여 필요한 사항은 총장이 따로 정한다.',
    '제 52 조 (총학생회)\n건전한 학풍을 조성하고 학생자치활동을 신장시키기 위하여 한동대학교 총학생회(이하 "총학생회"라 한다)를 둔다.\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: 57 training samples
  • Columns: sentence_0, sentence_1, sentence_2, and sentence_3
  • Approximate statistics based on the first 57 samples:
    sentence_0 sentence_1 sentence_2 sentence_3
    type string string string string
    details
    • min: 14 tokens
    • mean: 25.53 tokens
    • max: 43 tokens
    • min: 18 tokens
    • mean: 116.4 tokens
    • max: 512 tokens
    • min: 25 tokens
    • mean: 85.26 tokens
    • max: 435 tokens
    • min: 34 tokens
    • mean: 71.05 tokens
    • max: 321 tokens
  • Samples:
    sentence_0 sentence_1 sentence_2 sentence_3
    한동대학교의 학사 연도와 학기 구성은 어떻게 되어 있나요? 자유학기나 계절학기도 운영되나요? 제 7 조 (학년도 및 학기)
    학년도는 3월 1일부터 다음해 2월말일까지로 한다.
    학년도는 다음과 같이 두 학기로 나누는 것을 원칙으로 한다.
    다만, 수업은 2주를 초과하지 않는 범위내에서 학기 개시일 전에 개강할 수 있다.
    제1학기 : 3월 1일부터 8월 31일까지.
    제2학기 : 9월 1일부터 다음해 2월 말일까지.
    하기 및 동기 방학기간 중에 1개 이상의 계절학기를 둘 수 있으며, 계절학기 운영에 관한 사항은 총장이 따로 정한다.
    정규학기 중 학생들이 자기주도적 학습활동을 할 수 있는 자유학기를 둘 수 있으며, 자유학기 운영에 관한 사항은 총장이 따로 정한다.
    정규학기 및 계절학기 중 학생들이 진로적성 탐색에 집중하거나 문제발굴과 해결을 위한 참여적 학습활동 위주의 혁신학기를 둘 수 있으며, 혁신학기 운영에 관한 사항은 총장이 따로 정한다.
    제목: 한동대학교 학칙
    소관부서: 교무팀 1073, 1074
    학교웹페이지: https://rule.handong.edu
    제 52 조 (총학생회)
    건전한 학풍을 조성하고 학생자치활동을 신장시키기 위하여 한동대학교 총학생회(이하 "총학생회"라 한다)를 둔다.
    총학생회의 조직과 운영에 관한 사항은 총장의 승인을 얻어 학생회칙으로 따로 정한다.
    전시·사변 또는 이에 준하는 국가 비상사태시에는 그 활동이 정지된다.
    한동대학교에서 학점은행제 운영 방식과 관련된 규정은 어떻게 되나요? 제 85 조 (글로벌 미래 평생교육원 학점은행제 운영)
    「학점은행 등에 관한 법률」에 따라 평가인정을 받는 학습과정을 이수한 자 등에게 학점인정을 통하여 학력인정의 기회를 부여하는 학점은행제를 운영할 수 있다.
    학점은행제 운영과 관련하여 학점의 인정범위 및 학적관리 등에 관한 사항은 총장이 따로 정한다.
    제 1 조 (목적)
    이 학칙은 한동대학교(이하 "이 대학교"라 한다) 교훈의 실천과 교육이념, 교육목적 및 교육목표를 달성하기 위한 교육조직, 학사운영 등에 관한 사항을 규정함을 목적으로 한다.
    제목: 한동대학교 학칙
    소관부서: 교무팀 1073, 1074
    학교웹페이지: https://rule.handong.edu
    한동대학교 총학생회 활동은 어떻게 진행되며, 비상사태 시에는 어떻게 되나요? 제 52 조 (총학생회)
    건전한 학풍을 조성하고 학생자치활동을 신장시키기 위하여 한동대학교 총학생회(이하 "총학생회"라 한다)를 둔다.
    총학생회의 조직과 운영에 관한 사항은 총장의 승인을 얻어 학생회칙으로 따로 정한다.
    전시·사변 또는 이에 준하는 국가 비상사태시에는 그 활동이 정지된다.
    제 52 조 (총학생회)
    건전한 학풍을 조성하고 학생자치활동을 신장시키기 위하여 한동대학교 총학생회(이하 "총학생회"라 한다)를 둔다.
    총학생회의 조직과 운영에 관한 사항은 총장의 승인을 얻어 학생회칙으로 따로 정한다.
    전시·사변 또는 이에 준하는 국가 비상사태시에는 그 활동이 정지된다.
    제목: 한동대학교 학칙
    소관부서: 교무팀 1073, 1074
    학교웹페이지: https://rule.handong.edu
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 1
  • per_device_eval_batch_size: 1
  • 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: 1
  • per_device_eval_batch_size: 1
  • 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
0.6897 20

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

MultipleNegativesRankingLoss

@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply},
    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},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}
Downloads last month
158
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_MultipleNegativesRankingLossHR_fold0_10_5e-06

Base model

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