zbum's picture
Upload folder using huggingface_hub
03f3bd7 verified
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

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

Metric Value
pearson_cosine 0.3477
spearman_cosine 0.3556

Semantic Similarity

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, and label
  • 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: CosineSimilarityLoss with these parameters:
    {
        "loss_fct": "torch.nn.modules.loss.MSELoss"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • num_train_epochs: 4
  • 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: 16
  • per_device_eval_batch_size: 16
  • 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: 4
  • 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: False
  • 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: None
  • hub_always_push: False
  • hub_revision: None
  • 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
  • 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
  • liger_kernel_config: None
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin
  • router_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",
}