CoolFace
Modelpublic

josangho99/ko-multilingual-e5-small-multiTask

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes10downloads
README.md427 linesDownload Raw Back to root
1---2tags:3- sentence-transformers4- sentence-similarity5- feature-extraction6- dense7- generated_from_trainer8- dataset_size:5743899- loss:MultipleNegativesRankingLoss10- loss:CosineSimilarityLoss11base_model: intfloat/multilingual-e5-small12widget:13- source_sentence: 전 나치 죽음의 수용소 경비원 뎀잔주크 91세 사망14  sentences:15  - 나치 사형수 수용소 경비원으로 유죄 판결을 받은 존 뎀잔죽 은 91세의 나이로 사망한다16  - 2040년까지 은퇴자들은 인구의 3분의 1을 차지할 것이며, 이는 오늘의 5분의 1에서 증가할 것이다.17  - 이집트에서 살해된 스카이 뉴스 카메라맨18- source_sentence: 이슬 맺음의 제안은 논란이 되고 있는 "로빈 후드" 학교 재정 계획을 갑작스럽게 끝낼 것을 요구한다.19  sentences:20  - 위원회는 "로빈 후드" 학교 재정 시스템을 대체할 것을 제안할 것이다.21  - 자마트 아이슬라미의 청소년 단체의 시위는 이라크에 대한 미국의 공격에 반대했다.22  - 중앙 이스라엘 교통 사고로 2명 사망, 8명 부상23- source_sentence: 두 남자가 일하고 있다24  sentences:25  - 한 여성이 보도를 걸어가면서 카메라를 더러워 보이고 있다.26  - 두 남자가 스포츠 바에 있다27  - 사다리를 든 두 남자가 울타리를 치고 있다.28- source_sentence: 아기가 안고 있다29  sentences:30  - 아기가 총을 들고 있다31  - 그 소년은 작다32  - 어린 아기가 형의 머리를 잡고 있다.33- source_sentence: 여자와 아이가 게임을 하고 있다.34  sentences:35  - 물가는 확실히 올랐지만 품질 기준도 마찬가지다.36  - 한 여성과 그녀의 아이가 영화를 보고 있다.37  - 여자와 어린 아이는 보드게임을 하면서 즐거운 시간을 보낸다.38pipeline_tag: sentence-similarity39library_name: sentence-transformers40metrics:41- pearson_cosine42- spearman_cosine43model-index:44- name: SentenceTransformer based on intfloat/multilingual-e5-small45  results:46  - task:47      type: semantic-similarity48      name: Semantic Similarity49    dataset:50      name: sts dev51      type: sts-dev52    metrics:53    - type: pearson_cosine54      value: 0.849099516497947155      name: Pearson Cosine56    - type: spearman_cosine57      value: 0.848115444663208558      name: Spearman Cosine59---60 61# SentenceTransformer based on intfloat/multilingual-e5-small62 63This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [intfloat/multilingual-e5-small](https://huggingface.co/intfloat/multilingual-e5-small). It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.64 65## Model Details66 67### Model Description68- **Model Type:** Sentence Transformer69- **Base model:** [intfloat/multilingual-e5-small](https://huggingface.co/intfloat/multilingual-e5-small) <!-- at revision c007d7ef6fd86656326059b28395a7a03a7c5846 -->70- **Maximum Sequence Length:** 128 tokens71- **Output Dimensionality:** 384 dimensions72- **Similarity Function:** Cosine Similarity73<!-- - **Training Dataset:** Unknown -->74<!-- - **Language:** Unknown -->75<!-- - **License:** Unknown -->76 77### Model Sources78 79- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)80- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)81- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)82 83### Full Model Architecture84 85```86SentenceTransformer(87  (0): Transformer({'max_seq_length': 128, 'do_lower_case': False, 'architecture': 'BertModel'})88  (1): Pooling({'word_embedding_dimension': 384, '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})89)90```91 92## Usage93 94### Direct Usage (Sentence Transformers)95 96First install the Sentence Transformers library:97 98```bash99pip install -U sentence-transformers100```101 102Then you can load this model and run inference.103```python104from sentence_transformers import SentenceTransformer105 106# Download from the 🤗 Hub107model = SentenceTransformer("josangho99/ko-multilingual-e5-small-multiTask")108# Run inference109sentences = [110    '여자와 아이가 게임을 하고 있다.',111    '여자와 어린 아이는 보드게임을 하면서 즐거운 시간을 보낸다.',112    '한 여성과 그녀의 아이가 영화를 보고 있다.',113]114embeddings = model.encode(sentences)115print(embeddings.shape)116# [3, 384]117 118# Get the similarity scores for the embeddings119similarities = model.similarity(embeddings, embeddings)120print(similarities)121# tensor([[1.0000, 0.6531, 0.4611],122#         [0.6531, 1.0000, 0.3023],123#         [0.4611, 0.3023, 1.0000]])124```125 126<!--127### Direct Usage (Transformers)128 129<details><summary>Click to see the direct usage in Transformers</summary>130 131</details>132-->133 134<!--135### Downstream Usage (Sentence Transformers)136 137You can finetune this model on your own dataset.138 139<details><summary>Click to expand</summary>140 141</details>142-->143 144<!--145### Out-of-Scope Use146 147*List how the model may foreseeably be misused and address what users ought not to do with the model.*148-->149 150## Evaluation151 152### Metrics153 154#### Semantic Similarity155 156* Dataset: `sts-dev`157* Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)158 159| Metric              | Value      |160|:--------------------|:-----------|161| pearson_cosine      | 0.8491     |162| **spearman_cosine** | **0.8481** |163 164<!--165## Bias, Risks and Limitations166 167*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*168-->169 170<!--171### Recommendations172 173*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*174-->175 176## Training Details177 178### Training Datasets179 180#### Unnamed Dataset181 182* Size: 568,640 training samples183* Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>sentence_2</code>184* Approximate statistics based on the first 1000 samples:185  |         | sentence_0                                                                        | sentence_1                                                                         | sentence_2                                                                        |186  |:--------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|187  | type    | string                                                                            | string                                                                             | string                                                                            |188  | details | <ul><li>min: 4 tokens</li><li>mean: 19.75 tokens</li><li>max: 99 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 19.98 tokens</li><li>max: 128 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 14.82 tokens</li><li>max: 47 tokens</li></ul> |189* Samples:190  | sentence_0                                                             | sentence_1                                                                                                                                                     | sentence_2                                             |191  |:-----------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------|192  | <code>실버민 베이에는 섬의 다른 지역으로 가는 노선이 있는 버스 터미널이 있다.</code>                 | <code>페리는 오전 6시 10분에서 오후 10시 30분 사이에 2시간마다 센트럴에서 실버 마인 베이 (Mui Wo)로 출발하며 버스 터미널에는 섬의 모든 지역으로 버스가 있습니다.</code>                                                  | <code>실버민 만의 버스는 섬의 한 부분으로만 간다.</code>                 |193  | <code>사람이 사형선고를 받으면 국가가 형을 집행하고 그 사람을 사형에 처해야 하는데 항소절차가 없어야 한다.</code> | <code>어쨌든 내가 4 년 동안 주 교도소 시스템과 함께 일한 후, 당신이 그 사람에게 사형 선고를 계속하고 문장을 이해할 수있게 해주겠다고 결론을 내렸다는 결론은 누군가에게 사형 선고를 내리면 30 일 이내에 항소에 실패하면 한 번의 항소를 받게됩니다. 그것에 대해</code> | <code>사형수라면 형량이 감형될 때까지 원하는 만큼 항소할 수 있도록 해야 한다.</code> |194  | <code>웹 사이트 기능은 불편한 자원 봉사자를 지원합니다.</code>                              | <code>두 번째 웹 사이트 기능은 새로운 법률 분야에서 불편하고 지침과 방향이 필요한 자원 봉사자를 지원합니다.</code>                                                                                        | <code>두 번째 웹사이트 기능은 자원봉사자들에게 무료 아이스캔디를 제공한다.</code>    |195* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:196  ```json197  {198      "scale": 20.0,199      "similarity_fct": "cos_sim",200      "gather_across_devices": false201  }202  ```203 204#### Unnamed Dataset205 206* Size: 5,749 training samples207* Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>208* Approximate statistics based on the first 1000 samples:209  |         | sentence_0                                                                        | sentence_1                                                                        | label                                                          |210  |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|211  | type    | string                                                                            | string                                                                            | float                                                          |212  | details | <ul><li>min: 6 tokens</li><li>mean: 19.17 tokens</li><li>max: 54 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 19.06 tokens</li><li>max: 63 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.54</li><li>max: 1.0</li></ul> |213* Samples:214  | sentence_0                                           | sentence_1                               | label             |215  |:-----------------------------------------------------|:-----------------------------------------|:------------------|216  | <code>케냐 경찰 체포 키 알샤바브 신병 모집인 금융가</code>              | <code>케냐 : 대테러 경찰에 의해 체포된 쌍</code>       | <code>0.64</code> |217  | <code>"요정은 존재하지 않는다" - 좋아.</code>                    | <code>"레프리콘은 존재하지 않는다" - 좋아.</code>      | <code>0.2</code>  |218  | <code>당신이 필요로 하는 모든 것에 대한 가격은 인플레이션 때문에 상승했다.</code> | <code>당신이 소유한 모든 IE 자산의 가격이 하락했다.</code> | <code>0.4</code>  |219* Loss: [<code>CosineSimilarityLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:220  ```json221  {222      "loss_fct": "torch.nn.modules.loss.MSELoss"223  }224  ```225 226### Training Hyperparameters227#### Non-Default Hyperparameters228 229- `eval_strategy`: steps230- `num_train_epochs`: 5231- `batch_sampler`: no_duplicates232- `multi_dataset_batch_sampler`: round_robin233 234#### All Hyperparameters235<details><summary>Click to expand</summary>236 237- `overwrite_output_dir`: False238- `do_predict`: False239- `eval_strategy`: steps240- `prediction_loss_only`: True241- `per_device_train_batch_size`: 8242- `per_device_eval_batch_size`: 8243- `per_gpu_train_batch_size`: None244- `per_gpu_eval_batch_size`: None245- `gradient_accumulation_steps`: 1246- `eval_accumulation_steps`: None247- `torch_empty_cache_steps`: None248- `learning_rate`: 5e-05249- `weight_decay`: 0.0250- `adam_beta1`: 0.9251- `adam_beta2`: 0.999252- `adam_epsilon`: 1e-08253- `max_grad_norm`: 1254- `num_train_epochs`: 5255- `max_steps`: -1256- `lr_scheduler_type`: linear257- `lr_scheduler_kwargs`: {}258- `warmup_ratio`: 0.0259- `warmup_steps`: 0260- `log_level`: passive261- `log_level_replica`: warning262- `log_on_each_node`: True263- `logging_nan_inf_filter`: True264- `save_safetensors`: True265- `save_on_each_node`: False266- `save_only_model`: False267- `restore_callback_states_from_checkpoint`: False268- `no_cuda`: False269- `use_cpu`: False270- `use_mps_device`: False271- `seed`: 42272- `data_seed`: None273- `jit_mode_eval`: False274- `use_ipex`: False275- `bf16`: False276- `fp16`: False277- `fp16_opt_level`: O1278- `half_precision_backend`: auto279- `bf16_full_eval`: False280- `fp16_full_eval`: False281- `tf32`: None282- `local_rank`: 0283- `ddp_backend`: None284- `tpu_num_cores`: None285- `tpu_metrics_debug`: False286- `debug`: []287- `dataloader_drop_last`: False288- `dataloader_num_workers`: 0289- `dataloader_prefetch_factor`: None290- `past_index`: -1291- `disable_tqdm`: False292- `remove_unused_columns`: True293- `label_names`: None294- `load_best_model_at_end`: False295- `ignore_data_skip`: False296- `fsdp`: []297- `fsdp_min_num_params`: 0298- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}299- `fsdp_transformer_layer_cls_to_wrap`: None300- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}301- `parallelism_config`: None302- `deepspeed`: None303- `label_smoothing_factor`: 0.0304- `optim`: adamw_torch_fused305- `optim_args`: None306- `adafactor`: False307- `group_by_length`: False308- `length_column_name`: length309- `ddp_find_unused_parameters`: None310- `ddp_bucket_cap_mb`: None311- `ddp_broadcast_buffers`: False312- `dataloader_pin_memory`: True313- `dataloader_persistent_workers`: False314- `skip_memory_metrics`: True315- `use_legacy_prediction_loop`: False316- `push_to_hub`: False317- `resume_from_checkpoint`: None318- `hub_model_id`: None319- `hub_strategy`: every_save320- `hub_private_repo`: None321- `hub_always_push`: False322- `hub_revision`: None323- `gradient_checkpointing`: False324- `gradient_checkpointing_kwargs`: None325- `include_inputs_for_metrics`: False326- `include_for_metrics`: []327- `eval_do_concat_batches`: True328- `fp16_backend`: auto329- `push_to_hub_model_id`: None330- `push_to_hub_organization`: None331- `mp_parameters`: 332- `auto_find_batch_size`: False333- `full_determinism`: False334- `torchdynamo`: None335- `ray_scope`: last336- `ddp_timeout`: 1800337- `torch_compile`: False338- `torch_compile_backend`: None339- `torch_compile_mode`: None340- `include_tokens_per_second`: False341- `include_num_input_tokens_seen`: False342- `neftune_noise_alpha`: None343- `optim_target_modules`: None344- `batch_eval_metrics`: False345- `eval_on_start`: False346- `use_liger_kernel`: False347- `liger_kernel_config`: None348- `eval_use_gather_object`: False349- `average_tokens_across_devices`: False350- `prompts`: None351- `batch_sampler`: no_duplicates352- `multi_dataset_batch_sampler`: round_robin353- `router_mapping`: {}354- `learning_rate_mapping`: {}355 356</details>357 358### Training Logs359| Epoch  | Step | Training Loss | sts-dev_spearman_cosine |360|:------:|:----:|:-------------:|:-----------------------:|361| 0.3477 | 500  | 0.3954        | -                       |362| 0.6954 | 1000 | 0.3058        | 0.8398                  |363| 1.0    | 1438 | -             | 0.8456                  |364| 1.0431 | 1500 | 0.2945        | -                       |365| 1.3908 | 2000 | 0.2003        | 0.8440                  |366| 1.7385 | 2500 | 0.1785        | -                       |367| 2.0    | 2876 | -             | 0.8459                  |368| 2.0862 | 3000 | 0.1774        | 0.8471                  |369| 2.4339 | 3500 | 0.1271        | -                       |370| 2.7816 | 4000 | 0.1278        | 0.8481                  |371 372 373### Framework Versions374- Python: 3.12.11375- Sentence Transformers: 5.1.0376- Transformers: 4.56.1377- PyTorch: 2.8.0+cu126378- Accelerate: 1.10.1379- Datasets: 4.0.0380- Tokenizers: 0.22.0381 382## Citation383 384### BibTeX385 386#### Sentence Transformers387```bibtex388@inproceedings{reimers-2019-sentence-bert,389    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",390    author = "Reimers, Nils and Gurevych, Iryna",391    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",392    month = "11",393    year = "2019",394    publisher = "Association for Computational Linguistics",395    url = "https://arxiv.org/abs/1908.10084",396}397```398 399#### MultipleNegativesRankingLoss400```bibtex401@misc{henderson2017efficient,402    title={Efficient Natural Language Response Suggestion for Smart Reply},403    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},404    year={2017},405    eprint={1705.00652},406    archivePrefix={arXiv},407    primaryClass={cs.CL}408}409```410 411<!--412## Glossary413 414*Clearly define terms in order to be accessible across audiences.*415-->416 417<!--418## Model Card Authors419 420*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*421-->422 423<!--424## Model Card Contact425 426*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*427-->