metadata
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:9450
- loss:CosineSimilarityLoss
base_model: klue/roberta-base
widget:
- source_sentence: 전자레인지를 사용할 수 있고 레토르트 음식을 데우는 정도의 조리는 가능합니다.
sentences:
- 지자체별 내역은 보도자료를 참고하여 주시기 바랍니다.
- 역까지는 버스를 타야 갈 수 있는 정도예요.
- 부엌이나 세탁기에 아무런 문제가 없어요.
- source_sentence: 자꾸 늦지 말고 아침 운동 일정을 잘 지켰으면 한다.
sentences:
- 지금 ‘코로나19’의 엄중한 상황을 헤쳐 가는 힘도
- 포기하지 말고 아침 운동 일정을 잘 지키자.
- 이것은 숙박비가 매우 비싼 샌프란시스코에서 합리적인 선택입니다.
- source_sentence: 주차비가 무료인것도 아주 큰 메리트입니다 가격대비 만족스럽습니다
sentences:
- 샤워실 배수가 좀 약하긴 하지만 가격대비 강추합니다.
- 주차가 무료인 것도 큰 장점입니다. 가격에 만족해요.
- 인터넷이나 모바일 앱을 통한 예약 및 여객선 발행을 허용하는 모바일 탑승권 제도가 모든 여객선으로 확대됩니다.
- source_sentence: 또한 숙소앞에 있을거는 다있기 때문에 불편한것도 없었읍니다
sentences:
- >-
비무장지대에서 뛰어난 생태, 문화, 역사적 자원을 생생하게 체험할 수 있는 "DMZ 평화의 길" 7개 노선이 올해 추가로 개통될
예정입니다.
- 우리는 9일 동안 이곳에서 즐거운 시간을 보냈습니다.
- 숙소 바로 앞에 편의점 있는 것도 마음에 들었습니다
- 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.766808334759943
name: Pearson Cosine
- type: spearman_cosine
value: 0.7976937723825233
name: Spearman Cosine
- type: pearson_cosine
value: 0.9411712662160735
name: Pearson Cosine
- type: spearman_cosine
value: 0.8931997913185528
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 1536-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: 1536 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': True, '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, 1536]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[ 1.0000, 0.8597, -0.0019],
# [ 0.8597, 1.0000, 0.0306],
# [-0.0019, 0.0306, 1.0000]])
Evaluation
Metrics
Semantic Similarity
- Evaluated with
EmbeddingSimilarityEvaluator
| Metric | Value |
|---|---|
| pearson_cosine | 0.7668 |
| spearman_cosine | 0.7977 |
Semantic Similarity
- Evaluated with
EmbeddingSimilarityEvaluator
| Metric | Value |
|---|---|
| pearson_cosine | 0.9412 |
| spearman_cosine | 0.8932 |
Training Details
Training Dataset
Unnamed Dataset
- Size: 9,450 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: 6 tokens
- mean: 20.09 tokens
- max: 65 tokens
- min: 6 tokens
- mean: 19.38 tokens
- max: 58 tokens
- min: 0.0
- mean: 0.43
- max: 1.0
- Samples:
sentence_0 sentence_1 label 근데 시설이랑 뷰랑 그런 게 다 했어요집 근처에 슈퍼마켓 과일야채가게 다가까워요.0.0다만 오페라하우스는 10분이상 걸려요 추천할만한 곳 입니다하지만 오페라 하우스는 추천하는데 10분 이상이 걸립니다.0.6799999999999999호주의 전형적인 주택가의 분위기와 주택을 느낄 수 있었던 것 같습니다.호주의 전형적인 주택가의 분위기와 주거를 느낄 수 있었습니다.0.9199999999999999 - 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}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_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.8052 |
| 0.8460 | 500 | 0.1543 | - |
| 1.0 | 591 | - | 0.8582 |
| 1.6920 | 1000 | 0.0305 | 0.8766 |
| 2.0 | 1182 | - | 0.8779 |
| 2.5381 | 1500 | 0.0195 | - |
| 3.0 | 1773 | - | 0.8885 |
| 3.3841 | 2000 | 0.0126 | 0.8901 |
| 4.0 | 2364 | - | 0.8932 |
Framework Versions
- Python: 3.12.11
- Sentence Transformers: 5.1.0
- Transformers: 4.56.1
- PyTorch: 2.8.0+cu126
- Accelerate: 1.10.1
- Datasets: 4.0.0
- Tokenizers: 0.22.0
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",
}