SentenceTransformer based on dragonkue/multilingual-e5-small-ko-v2

This is a sentence-transformers model finetuned from dragonkue/multilingual-e5-small-ko-v2 on the json dataset. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for retrieval.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: dragonkue/multilingual-e5-small-ko-v2
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 384 dimensions
  • Similarity Function: Cosine Similarity
  • Supported Modality: Text
  • Training Dataset:
    • json

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'BertModel'})
  (1): Pooling({'embedding_dimension': 384, 'pooling_mode': 'mean', 'include_prompt': True})
  (2): Normalize({})
)

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
queries = [
    'query: 병과명',
]
documents = [
    'passage: 한글명: 병과명\n영문약어명: BR_NM\n단어조합: 병과 + 명\n단어영문약어조합: BR + NM\n단어도메인분류조합: 명\n마지막단어: 명\n마지막단어도메인분류명: 명\n설명: 군사조직에서 군인이 능력에 따라 수행하는 주요 임무를 분류한 것의 이름',
    'passage: 한글명: 변환파일명\n영문약어명: TRSF_FILE_NM\n단어조합: 변환 + 파일 + 명\n단어영문약어조합: TRSF + FILE + NM\n단어도메인분류조합: 명\n마지막단어: 명\n마지막단어도메인분류명: 명\n설명: 다르게 하여 바꾼 파일의 이름',
    'passage: 한글명: 국가명\n영문약어명: NTN_NM\n단어조합: 국가 + 명\n단어영문약어조합: NTN + NM\n단어도메인분류조합: 명\n마지막단어: 명\n마지막단어도메인분류명: 명\n설명: 일정한 영토와 거기에 사는 사람들로 구성되고, 주권(主權)에 따른 하나의 통치 조직을 가지고 있는 사회 집단의 이름\n이음동의어: 나라명, 국가명칭, 국가이름, 나라명칭, 나라이름',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 384] [3, 384]

# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[0.9488, 0.0378, 0.2989]])

Evaluation

Metrics

Information Retrieval

Metric Value
cosine_accuracy@1 0.9889
cosine_accuracy@3 0.9997
cosine_accuracy@5 0.9997
cosine_precision@1 0.9889
cosine_precision@3 0.3332
cosine_precision@5 0.1999
cosine_precision@10 0.1
cosine_recall@1 0.9889
cosine_recall@3 0.9997
cosine_recall@5 0.9997
cosine_recall@10 1.0
cosine_ndcg@10 0.9955
cosine_mrr@10 0.994
cosine_map@100 0.994

Training Details

Training Dataset

json

  • Dataset: json
  • Size: 25,358 training samples
  • Columns: anchor, positive, and negative
  • Approximate statistics based on the first 100 samples:
    anchor positive negative
    type string string string
    modality text text text
    details
    • min: 6 tokens
    • mean: 7.65 tokens
    • max: 10 tokens
    • min: 64 tokens
    • mean: 84.45 tokens
    • max: 105 tokens
    • min: 73 tokens
    • mean: 102.46 tokens
    • max: 150 tokens
  • Samples:
    anchor positive negative
    query: 고도 passage: 한글명: 고도
    영문약어명: ALTD
    단어조합: 고도
    단어영문약어조합: ALTD
    단어도메인분류조합: 수
    마지막단어: 고도
    마지막단어도메인분류명: 수
    설명: 평균 해수면 따위를 0으로 하여 측정한 대상 물체의 높이
    passage: 한글명: 해발고도
    영문약어명: ELVT_ALTD
    단어조합: 해발 + 고도
    단어영문약어조합: ELVT + ALTD
    단어도메인분류조합: 수
    마지막단어: 고도
    마지막단어도메인분류명: 수
    설명: 평균 해수면을 기준으로 하여 잰 어떤 지점의 높이
    query: 국비 passage: 한글명: 국비
    영문약어명: GVEXP
    단어조합: 국비
    단어영문약어조합: GVEXP
    단어도메인분류조합: 비용
    마지막단어: 국비
    마지막단어도메인분류명: 비용
    설명: 나라의 재정으로 부담하는 비용
    passage: 한글명: 국민주택기금금액
    영문약어명: NHFND_AMT
    단어조합: 국민주택기금 + 금액
    단어영문약어조합: NHFND + AMT
    단어도메인분류조합: 금액
    마지막단어: 금액
    마지막단어도메인분류명: 금액
    설명: 한 세대당 85㎡ 이하로 규정된 국민 주택의 건설하는 것을 지원할 목적으로 마련한 기금에서 지원·융자 또는 보조하는 돈의 액수
    query: 군번 passage: 한글명: 군번
    영문약어명: SRVNO
    단어조합: 군번
    단어영문약어조합: SRVNO
    단어도메인분류조합: 번호
    마지막단어: 군번
    마지막단어도메인분류명: 번호
    설명: 군인 개인마다 주어지는 고유 번호
    passage: 한글명: 군경력개월수
    영문약어명: MLCR_MCNT
    단어조합: 군경력 + 개월수
    단어영문약어조합: MLCR + MCNT
    단어도메인분류조합: 수
    마지막단어: 개월수
    마지막단어도메인분류명: 수
    설명: 군에 복무한 경력에 대한 개월의 수
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false,
        "directions": [
            "query_to_doc"
        ],
        "partition_mode": "joint",
        "hardness_mode": null,
        "hardness_strength": 0.0
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 32
  • num_train_epochs: 2
  • learning_rate: 2e-05
  • warmup_steps: 0.1
  • fp16: True
  • dataloader_drop_last: True
  • batch_sampler: no_duplicates

All Hyperparameters

Click to expand
  • per_device_train_batch_size: 32
  • num_train_epochs: 2
  • max_steps: -1
  • learning_rate: 2e-05
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: None
  • warmup_steps: 0.1
  • optim: adamw_torch_fused
  • optim_args: None
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • optim_target_modules: None
  • gradient_accumulation_steps: 1
  • average_tokens_across_devices: True
  • max_grad_norm: 1.0
  • label_smoothing_factor: 0.0
  • bf16: False
  • fp16: True
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • use_liger_kernel: False
  • liger_kernel_config: None
  • use_cache: False
  • neftune_noise_alpha: None
  • torch_empty_cache_steps: None
  • auto_find_batch_size: False
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • include_num_input_tokens_seen: no
  • log_level: passive
  • log_level_replica: warning
  • disable_tqdm: False
  • project: huggingface
  • trackio_space_id: None
  • trackio_bucket_id: None
  • trackio_static_space_id: None
  • per_device_eval_batch_size: 8
  • prediction_loss_only: True
  • eval_on_start: False
  • eval_do_concat_batches: True
  • eval_use_gather_object: False
  • eval_accumulation_steps: None
  • include_for_metrics: []
  • batch_eval_metrics: False
  • save_only_model: False
  • save_on_each_node: False
  • enable_jit_checkpoint: False
  • push_to_hub: False
  • hub_private_repo: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_always_push: False
  • hub_revision: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • restore_callback_states_from_checkpoint: False
  • full_determinism: False
  • seed: 42
  • data_seed: None
  • use_cpu: False
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • parallelism_config: None
  • dataloader_drop_last: True
  • dataloader_num_workers: 0
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • dataloader_prefetch_factor: None
  • remove_unused_columns: True
  • label_names: None
  • train_sampling_strategy: random
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • ddp_static_graph: None
  • ddp_backend: None
  • ddp_timeout: 1800
  • fsdp: None
  • fsdp_config: None
  • deepspeed: None
  • debug: []
  • skip_memory_metrics: True
  • do_predict: False
  • resume_from_checkpoint: None
  • warmup_ratio: None
  • local_rank: -1
  • prompts: None
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Epoch Step Training Loss meta-assistant-terms_cosine_ndcg@10
-1 -1 - 0.9082
0.0253 20 1.0291 -
0.0505 40 0.4264 -
0.0758 60 0.1148 -
0.1010 80 0.0439 -
0.1263 100 0.0415 -
0.1515 120 0.0254 -
0.1768 140 0.0248 -
0.2020 160 0.0183 -
0.2273 180 0.0152 -
0.2525 200 0.0155 -
0.2778 220 0.0180 -
0.3030 240 0.0240 -
0.3283 260 0.0119 -
0.3535 280 0.0235 -
0.3788 300 0.0164 -
0.4040 320 0.0094 -
0.4293 340 0.0075 -
0.4545 360 0.0067 -
0.4798 380 0.0072 -
0.5051 400 0.0081 -
0.5303 420 0.0071 -
0.5556 440 0.0078 -
0.5808 460 0.0077 -
0.6061 480 0.0093 -
0.6313 500 0.0109 -
0.6566 520 0.0075 -
0.6818 540 0.0036 -
0.7071 560 0.0046 -
0.7323 580 0.0056 -
0.7576 600 0.0061 -
0.7828 620 0.0052 -
0.8081 640 0.0056 -
0.8333 660 0.0081 -
0.8586 680 0.0065 -
0.8838 700 0.0043 -
0.9091 720 0.0067 -
0.9343 740 0.0049 -
0.9596 760 0.0038 -
0.9848 780 0.0054 -
1.0 792 - 0.9951
1.0101 800 0.0088 -
1.0354 820 0.0053 -
1.0606 840 0.0049 -
1.0859 860 0.0070 -
1.1111 880 0.0038 -
1.1364 900 0.0037 -
1.1616 920 0.0041 -
1.1869 940 0.0028 -
1.2121 960 0.0111 -
1.2374 980 0.0041 -
1.2626 1000 0.0040 -
1.2879 1020 0.0043 -
1.3131 1040 0.0034 -
1.3384 1060 0.0068 -
1.3636 1080 0.0040 -
1.3889 1100 0.0027 -
1.4141 1120 0.0036 -
1.4394 1140 0.0047 -
1.4646 1160 0.0051 -
1.4899 1180 0.0073 -
1.5152 1200 0.0052 -
1.5404 1220 0.0034 -
1.5657 1240 0.0056 -
1.5909 1260 0.0054 -
1.6162 1280 0.0100 -
1.6414 1300 0.0049 -
1.6667 1320 0.0034 -
1.6919 1340 0.0045 -
1.7172 1360 0.0027 -
1.7424 1380 0.0036 -
1.7677 1400 0.0024 -
1.7929 1420 0.0071 -
1.8182 1440 0.0050 -
1.8434 1460 0.0020 -
1.8687 1480 0.0028 -
1.8939 1500 0.0065 -
1.9192 1520 0.0028 -
1.9444 1540 0.0051 -
1.9697 1560 0.0075 -
1.9949 1580 0.0034 -
2.0 1584 - 0.9955

Training Time

  • Training: 7.6 minutes

Framework Versions

  • Python: 3.12.13
  • Sentence Transformers: 5.6.0
  • Transformers: 5.12.1
  • PyTorch: 2.11.0+cu128
  • Accelerate: 1.14.0
  • Datasets: 4.0.0
  • Tokenizers: 0.22.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",
}

MultipleNegativesRankingLoss

@misc{oord2019representationlearningcontrastivepredictive,
      title={Representation Learning with Contrastive Predictive Coding},
      author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
      year={2019},
      eprint={1807.03748},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1807.03748},
}
Downloads last month
78
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for kongchan/e5-word-meta-ko

Finetuned
(1)
this model

Papers for kongchan/e5-word-meta-ko

Evaluation results