Downloads · 30 days
86
23% of all-time downloads
kongchan/e5-word-meta-ko
e5-word-meta-ko is a sentence similarity model from kongchan. Use it when you need a score for how close two texts are. It is set up for sentence-transformers.
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.
Downloads · 30 days
86
23% of all-time downloads
All-time downloads
379
Public
Parameters
118M
958 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors471 MB · 96%
From the Hugging Face model README
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.
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({})
)
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]])
<!--
### Direct Usage (Transformers)
<details><summary>Click to see the direct usage in Transformers</summary>
</details>
-->
<!--
### Downstream Usage (Sentence Transformers)
You can finetune this model on your own dataset.
<details><summary>Click to expand</summary>
</details>
-->
<!--
### Out-of-Scope Use
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->
meta-assistant-terms| 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 |
| anchor | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| modality | text | text | text |
| details | <ul><li>min: 6 tokens</li><li>mean: 7.65 tokens</li><li>max: 10 tokens</li></ul> | <ul><li>min: 64 tokens</li><li>mean: 84.45 tokens</li><li>max: 105 tokens</li></ul> | <ul><li>min: 73 tokens</li><li>mean: 102.46 tokens</li><li>max: 150 tokens</li></ul> |
| anchor | positive | negative |
|---|---|---|
| <code>query: 고도</code> | <code>passage: 한글명: 고도<br>영문약어명: ALTD<br>단어조합: 고도<br>단어영문약어조합: ALTD<br>단어도메인분류조합: 수<br>마지막단어: 고도<br>마지막단어도메인분류명: 수<br>설명: 평균 해수면 따위를 0으로 하여 측정한 대상 물체의 높이</code> | <code>passage: 한글명: 해발고도<br>영문약어명: ELVT_ALTD<br>단어조합: 해발 + 고도<br>단어영문약어조합: ELVT + ALTD<br>단어도메인분류조합: 수<br>마지막단어: 고도<br>마지막단어도메인분류명: 수<br>설명: 평균 해수면을 기준으로 하여 잰 어떤 지점의 높이</code> |
| <code>query: 국비</code> | <code>passage: 한글명: 국비<br>영문약어명: GVEXP<br>단어조합: 국비<br>단어영문약어조합: GVEXP<br>단어도메인분류조합: 비용<br>마지막단어: 국비<br>마지막단어도메인분류명: 비용<br>설명: 나라의 재정으로 부담하는 비용</code> | <code>passage: 한글명: 국민주택기금금액<br>영문약어명: NHFND_AMT<br>단어조합: 국민주택기금 + 금액<br>단어영문약어조합: NHFND + AMT<br>단어도메인분류조합: 금액<br>마지막단어: 금액<br>마지막단어도메인분류명: 금액<br>설명: 한 세대당 85㎡ 이하로 규정된 국민 주택의 건설하는 것을 지원할 목적으로 마련한 기금에서 지원·융자 또는 보조하는 돈의 액수</code> |
| <code>query: 군번</code> | <code>passage: 한글명: 군번<br>영문약어명: SRVNO<br>단어조합: 군번<br>단어영문약어조합: SRVNO<br>단어도메인분류조합: 번호<br>마지막단어: 군번<br>마지막단어도메인분류명: 번호<br>설명: 군인 개인마다 주어지는 고유 번호</code> | <code>passage: 한글명: 군경력개월수<br>영문약어명: MLCR_MCNT<br>단어조합: 군경력 + 개월수<br>단어영문약어조합: MLCR + MCNT<br>단어도메인분류조합: 수<br>마지막단어: 개월수<br>마지막단어도메인분류명: 수<br>설명: 군에 복무한 경력에 대한 개월의 수</code> |
{
"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
}
per_device_train_batch_size: 32num_train_epochs: 2learning_rate: 2e-05warmup_steps: 0.1fp16: Truedataloader_drop_last: Truebatch_sampler: no_duplicatesper_device_train_batch_size: 32num_train_epochs: 2max_steps: -1learning_rate: 2e-05lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.1optim: adamw_torch_fusedoptim_args: Noneweight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 1average_tokens_across_devices: Truemax_grad_norm: 1.0label_smoothing_factor: 0.0bf16: Falsefp16: Truebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Nonetorch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneuse_liger_kernel: Falseliger_kernel_config: Noneuse_cache: Falseneftune_noise_alpha: Nonetorch_empty_cache_steps: Noneauto_find_batch_size: Falselog_on_each_node: Truelogging_nan_inf_filter: Trueinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Falseproject: huggingfacetrackio_space_id: Nonetrackio_bucket_id: Nonetrackio_static_space_id: Noneper_device_eval_batch_size: 8prediction_loss_only: Trueeval_on_start: Falseeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: Noneinclude_for_metrics: []batch_eval_metrics: Falsesave_only_model: Falsesave_on_each_node: Falseenable_jit_checkpoint: Falsepush_to_hub: Falsehub_private_repo: Nonehub_model_id: Nonehub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Falseignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 42data_seed: Noneuse_cpu: Falseaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedataloader_drop_last: Truedataloader_num_workers: 0dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_prefetch_factor: Noneremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_static_graph: Noneddp_backend: Noneddp_timeout: 1800fsdp: Nonefsdp_config: Nonedeepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonewarmup_ratio: Nonelocal_rank: -1prompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| 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 |
@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",
}
@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},
}
<!--
## Glossary
*Clearly define terms in order to be accessible across audiences.*
-->
<!--
## Model Card Authors
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->
<!--
## Model Card Contact
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->