--- tags: - sentence-transformers - sentence-similarity - feature-extraction - generated_from_trainer - dataset_size:10501 - loss:CosineSimilarityLoss base_model: klue/roberta-base widget: - source_sentence: 그밖에 자잘한 단점은 넘어가는거로 하겠습니다 sentences: - 전기는 조금씩 사용하는 것이 좋겠습니다. - 한국어 학회 시작일이 언제야? - 인테리어가 좋고 아주 깨끗한 집입니다. - source_sentence: 이번 다자간 전화 협의에는 한국, 캐나다, 호주, 브라질, 이탈리아, 터키 등 6개국 외교장관 및 유럽연합(EU) 외교안보정책 고위대표가 참여했다. sentences: - 예비농업인의 신규 영농창업 또는 농업인의 영농 규모화가 활성화 될 수 있도록, 정책자금 지원조건(거치·상환) 제도를 개선한다. - 요리에는 기름이나 다른 음식은 없지만, 두 사람에게 좋은 숙박시설이었습니다. - 이번 장관회의에 참석하는 국가는 우리나라를 비롯, 영국, 에스토니아, 덴마크, 캐나다, 이스라엘, 뉴질랜드, 우루과이, 포르투갈, 멕시코 등이다. - source_sentence: 어느 장소가 겨울에 만나기에 좋은지 추천해 주세요. sentences: - 한우 먹는 날을 기념하기 위한 온라인 소비 촉진 행사도 진행 중입니다. - 겨울에 만나려면 어디가 좋겠나요? - 숙소는사진에서 보여주는 그대로의 모습입니다. - source_sentence: 특히 두 분 너무 친절하시고 답변도 빠르세요. sentences: - 특히, 두 분은 친절하고 대답이 빠르시네요. - 두 번째 회의에서는, 불확실성이 증폭된 중소기업, 자영업자, 금융시장에 총 100조원을 투자하기로 했습니다. - 만약 여러분의 짐이 무겁고 크다면, 다시 생각해 보세요! - 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.34770710450413145 name: Pearson Cosine - type: spearman_cosine value: 0.35560473197486514 name: Spearman Cosine - type: pearson_cosine value: 0.9613863456262849 name: Pearson Cosine - type: spearman_cosine value: 0.9210441234774834 name: Spearman Cosine --- # SentenceTransformer based on klue/roberta-base This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [klue/roberta-base](https://huggingface.co/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](https://huggingface.co/klue/roberta-base) - **Maximum Sequence Length:** 512 tokens - **Output Dimensionality:** 768 dimensions - **Similarity Function:** Cosine Similarity ### Model Sources - **Documentation:** [Sentence Transformers Documentation](https://sbert.net) - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers) - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers) ### Full Model Architecture ``` SentenceTransformer( (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: 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: ```bash pip install -U sentence-transformers ``` Then you can load this model and run inference. ```python from sentence_transformers import SentenceTransformer # Download from the 🤗 Hub model = SentenceTransformer("sentence_transformers_model_id") # Run inference sentences = [ '개정안에 따라 신혼부부와 생애최초 특별공급에 대한\xa0소득요건이 완화된다.', '개정안에 따르면, 신혼부부의 소득 요건과 그들의 생애 첫 특별공급이 완화될 것입니다.', '지메일 이용시 최대 첨부 파일 용량이 궁금해요.', ] embeddings = model.encode(sentences) print(embeddings.shape) # [3, 768] # Get the similarity scores for the embeddings similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] ``` ## Evaluation ### Metrics #### Semantic Similarity * Evaluated with [EmbeddingSimilarityEvaluator](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator) | Metric | Value | |:--------------------|:-----------| | pearson_cosine | 0.3477 | | **spearman_cosine** | **0.3556** | #### Semantic Similarity * Evaluated with [EmbeddingSimilarityEvaluator](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator) | Metric | Value | |:--------------------|:----------| | pearson_cosine | 0.9614 | | **spearman_cosine** | **0.921** | ## 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 | | | | * Samples: | sentence_0 | sentence_1 | label | |:---------------------------------------------|:---------------------------------------------|:------------------| | 아웃룩을 윈도우 상에서 사용할 땐 용량이 얼마나 되나요? | 제가 어느 이메일로 학교 성적표를 받기로 했었죠? | 0.0 | | 몇 월 며칠에 남해에 꽃이 피는지 궁금합니다. | 비옷 대신으로 우산 챙기자. | 0.0 | | 다른것 보다 교통편이 너무너무 편했습니다. | 다른 유명 관광지들보다도 그곳이 가장 마음에 들었습니다. | 0.02 | * Loss: [CosineSimilarityLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters: ```json { "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 - `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 | Training Loss | spearman_cosine | |:------:|:----:|:-------------:|:---------------:| | -1 | -1 | - | 0.3556 | | 0.7610 | 500 | 0.0278 | - | | 1.0 | 657 | - | 0.9143 | | 1.5221 | 1000 | 0.0081 | 0.9130 | | 2.0 | 1314 | - | 0.9148 | | 2.2831 | 1500 | 0.005 | - | | 3.0 | 1971 | - | 0.9198 | | 3.0441 | 2000 | 0.0035 | 0.9195 | | 3.8052 | 2500 | 0.0025 | - | | 4.0 | 2628 | - | 0.9210 | ### Framework Versions - Python: 3.11.11 - Sentence Transformers: 3.4.1 - Transformers: 4.48.3 - PyTorch: 2.5.1+cu124 - Accelerate: 1.3.0 - Datasets: 3.3.2 - Tokenizers: 0.21.0 ## Citation ### BibTeX #### Sentence Transformers ```bibtex @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", } ```