metadata
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:10501
- loss:CosineSimilarityLoss
base_model: klue/roberta-base
widget:
- source_sentence: >-
노르웨이는 2025년, 덴마크와 네덜란드 2030년, 영국 2035년, 프랑스 2040년 등 이미 해외 각국에서는 내연차
판매·등록금지를 선언한 바 있다.
sentences:
- >-
지난 2011년에 도입된 ‘공공부문 온실가스 목표관리제’는 올해까지 기준배출량(2007~2009년 평균 배출량) 대비 30%
감축목표를 설정한 바 있다.
- 잘 때 선풍기 시간 조절 어떻게 해?
- 시중의 마스크 부족 원인이 복지부와 식약처의 마스크 주문 취소 때문이다?
- source_sentence: 약속 취소하면 시간이 붕 뜨니까 꼭 취소하지 말았으면 좋겠어.
sentences:
- 밤에는 등산을 금합니다.
- 현지인이 된 기분으로 생활할 수 있어요.
- 부모님이랑 약속을 했으면 깨지 않도록 해라.
- source_sentence: 아침과 저녁 중에 언제 할 것이 없다고 하셨었죠?
sentences:
- 욕실은 수압과 온수가 좋습니다.
- 아침에 한가하니, 저녁에 한가하니?
- 어떤가요? 돌아오는 휴일에 주말 날씨는.
- source_sentence: 그래도 가격대비 만족스런 숙소였습니다 !
sentences:
- 하지만 그 가격에 만족스러운 숙소였어요!
- 호스트로부터의 피드백에 연락을 취하게 되어 정말 좋았습니다.
- 또한, 수소 충전소 간 거리 규제가 완화될 것입니다.
- source_sentence: 우선 호스트가 아주 세심하고 친절합니다.
sentences:
- 우선, 사회자는 매우 세심하고 친절합니다.
- 저온 말고 미온으로 씻으세요. 열대야일 때.
- 다른 분들께도 강력하게 추천을 드려요!
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- pearson_cosine
- spearman_cosine
model-index:
- name: SentenceTransformer based on klue/roberta-base
results:
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: Unknown
type: unknown
metrics:
- type: pearson_cosine
value: 0.3477070303828638
name: Pearson Cosine
- type: spearman_cosine
value: 0.35560473197486514
name: Spearman Cosine
- type: pearson_cosine
value: 0.9624685588404969
name: Pearson Cosine
- type: spearman_cosine
value: 0.9215864985800423
name: Spearman Cosine
SentenceTransformer based on klue/roberta-base
This is a sentence-transformers model finetuned from klue/roberta-base. It maps sentences & paragraphs to a 768-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: klue/roberta-base
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 768 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': 512, 'do_lower_case': False, 'architecture': 'RobertaModel'})
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)
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 = [
'우선 호스트가 아주 세심하고 친절합니다.',
'우선, 사회자는 매우 세심하고 친절합니다.',
'저온 말고 미온으로 씻으세요. 열대야일 때.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.9201, 0.0349],
# [0.9201, 1.0000, 0.0070],
# [0.0349, 0.0070, 1.0000]])
Evaluation
Metrics
Semantic Similarity
- Evaluated with
EmbeddingSimilarityEvaluator
| Metric | Value |
|---|---|
| pearson_cosine | 0.3477 |
| spearman_cosine | 0.3556 |
Semantic Similarity
- Evaluated with
EmbeddingSimilarityEvaluator
| Metric | Value |
|---|---|
| pearson_cosine | 0.9625 |
| spearman_cosine | 0.9216 |
Training Details
Training Dataset
Unnamed Dataset
- Size: 10,501 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: 5 tokens
- mean: 20.11 tokens
- max: 59 tokens
- min: 5 tokens
- mean: 19.47 tokens
- max: 70 tokens
- min: 0.0
- mean: 0.44
- max: 1.0
- Samples:
sentence_0 sentence_1 label 그리고 무엇보다 엘리베이터가 있더군요!그리고 무엇보다도, 엘리베이터가 있었어요!0.9400000000000001현재 세계적으로 발병 중인 만큼 방역뿐 아니라 경제 등 다양한 국제 협력에서도 변화가 있을 것으로 본다.음악회는 ‘기억’과 ‘평화’를 주제로, 다양한 분야의 음악을 이야기가 있는 공연으로 구성해 참석자들에게 감동을 전할 것으로 보인다.0.0입국금지 조치를 취한 151개 국가·지역 중 우리나라와 사증면제협정을 체결했거나 우리 정부가 무사증입국을 허용한 90개 국가·지역에 대한 사증면제 조치를 잠정적으로 정지한다.또한 13일 0시부터(현지 출발시각 기준) 단기사증 효력정지 및 사증면제협정·무사증입국 잠정 정지 조치가 시행됨에 따라 단기체류 목적의 외국인 입국이 감소할 것으로 예상된다.0.2 - Loss:
CosineSimilarityLosswith these parameters:{ "loss_fct": "torch.nn.modules.loss.MSELoss" }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: stepsper_device_train_batch_size: 16per_device_eval_batch_size: 16num_train_epochs: 4multi_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: 16per_device_eval_batch_size: 16per_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: 4max_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: Falsefp16_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: Nonehub_always_push: Falsehub_revision: Nonegradient_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: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: round_robinrouter_mapping: {}learning_rate_mapping: {}
Training Logs
| Epoch | Step | Training Loss | spearman_cosine |
|---|---|---|---|
| -1 | -1 | - | 0.3556 |
| 0.7610 | 500 | 0.0281 | - |
| 1.0 | 657 | - | 0.9110 |
| 1.5221 | 1000 | 0.0081 | 0.9175 |
| 2.0 | 1314 | - | 0.9185 |
| 2.2831 | 1500 | 0.0052 | - |
| 3.0 | 1971 | - | 0.9213 |
| 3.0441 | 2000 | 0.0034 | 0.9212 |
| 3.8052 | 2500 | 0.0026 | - |
| 4.0 | 2628 | - | 0.9216 |
Framework Versions
- Python: 3.9.6
- Sentence Transformers: 5.0.0
- Transformers: 4.53.2
- PyTorch: 2.7.1
- Accelerate: 1.9.0
- Datasets: 4.0.0
- Tokenizers: 0.21.2
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",
}