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
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
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
, andlabel
- 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
: stepsper_device_train_batch_size
: 2per_device_eval_batch_size
: 2num_train_epochs
: 10fp16
: Truemulti_dataset_batch_sampler
: round_robin
All Hyperparameters
Click to expand
overwrite_output_dir
: Falsedo_predict
: Falseeval_strategy
: stepsprediction_loss_only
: Trueper_device_train_batch_size
: 2per_device_eval_batch_size
: 2per_gpu_train_batch_size
: Noneper_gpu_eval_batch_size
: Nonegradient_accumulation_steps
: 1eval_accumulation_steps
: Nonetorch_empty_cache_steps
: Nonelearning_rate
: 5e-05weight_decay
: 0.0adam_beta1
: 0.9adam_beta2
: 0.999adam_epsilon
: 1e-08max_grad_norm
: 1num_train_epochs
: 10max_steps
: -1lr_scheduler_type
: linearlr_scheduler_kwargs
: {}warmup_ratio
: 0.0warmup_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
: Falseuse_ipex
: 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
: 0dataloader_prefetch_factor
: Nonepast_index
: -1disable_tqdm
: Falseremove_unused_columns
: Truelabel_names
: Noneload_best_model_at_end
: Falseignore_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}deepspeed
: Nonelabel_smoothing_factor
: 0.0optim
: adamw_torchoptim_args
: Noneadafactor
: Falsegroup_by_length
: Falselength_column_name
: lengthddp_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
: Falsehub_always_push
: Falsegradient_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
: Nonedispatch_batches
: Nonesplit_batches
: Noneinclude_tokens_per_second
: Falseinclude_num_input_tokens_seen
: Falseneftune_noise_alpha
: Noneoptim_target_modules
: Nonebatch_eval_metrics
: Falseeval_on_start
: Falseuse_liger_kernel
: Falseeval_use_gather_object
: Falseaverage_tokens_across_devices
: Falseprompts
: Nonebatch_sampler
: batch_samplermulti_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
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support