Model Overview
Model Features
Model Capabilities
Use Cases
๐ SentenceTransformer based on intfloat/multilingual-e5-small
This is a Sentence Transformer model fine - tuned from intfloat/multilingual - e5 - small. It's optimized for Korean retrieval tasks and can map sentences & paragraphs to a 384 - dimensional dense vector space for various NLP applications.
๐ Quick Start
This is a sentence-transformers model finetuned from intfloat/multilingual-e5-small on datasets that include Korean query-passage pairs for improved performance on Korean retrieval tasks. 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.
This model is a lightweight Korean retriever, designed for ease of use and strong performance in practical retrieval tasks. It is ideal for running demos or lightweight applications, offering a good balance between speed and accuracy.
For even higher retrieval performance, we recommend combining it with a reranker. Suggested reranker models:
- dragonkue/bge-reranker-v2-m3-ko
- BAAI/bge-reranker-v2-m3
โจ Features
- Optimized for Korean retrieval tasks.
- Maps text to a 384 - dimensional dense vector space.
- Suitable for various NLP applications like semantic search and text classification.
- Lightweight and offers a good balance between speed and accuracy.
- Can be combined with a reranker for higher performance.
๐ฆ Installation
First, install the Sentence Transformers library:
pip install -U sentence-transformers
๐ป Usage Examples
Basic Usage
from sentence_transformers import SentenceTransformer
# Download from the ๐ค Hub
model = SentenceTransformer("dragonkue/multilingual-e5-small-ko")
# Run inference
sentences = [
'query: ๋ถํ๊ฐ์กฑ๋ฒ ๋ช ์ฐจ ๊ฐ์ ์์ ์ดํผํ๊ฒฐ ํ์ ํ 3๊ฐ์ ๋ด์ ๋ฑ๋ก์์๋ง ์ ํจํ๋ค๋ ์กฐํญ์ ํ์คํ ํ์๊น?',
'passage: 1990๋
์ ์ ์ ๋ ๋ถํ ๊ฐ์กฑ๋ฒ์ ์ง๊ธ๊น์ง 4์ฐจ๋ก ๊ฐ์ ๋์ด ํ์ฌ์ ์ด๋ฅด๊ณ ์๋ค. 1993๋
์ ์ด๋ฃจ์ด์ง ์ 1์ฐจ ๊ฐ์ ์ ์ฃผ๋ก ๊ท์ ์ ์ ํ์ฑ์ ๊ธฐํ๊ธฐ ์ํ์ฌ ๋ช๋ช ์กฐ๋ฌธ์ ์์ ํ ๊ฒ์ด๋ฉฐ, ์ค์ฒด์ ์ธ ๋ด์ฉ์ ๋ณด์ํ ๊ฒ์ ์์์ ์น์ธ๊ณผ ํฌ๊ธฐ๊ธฐ๊ฐ์ ์ค์ ํ ์ 52์กฐ ์ ๋๋ผ๊ณ ํ ์ ์๋ค. 2004๋
์ ์ด๋ฃจ์ด์ง ์ 2์ฐจ์ ๊ฐ์ ์์๋ ์ 20์กฐ์ 3ํญ์ ์ ์คํ์ฌ ์ฌํ์ ํ์ ๋ ์ดํผํ๊ฒฐ์ 3๊ฐ์ ๋ด์ ๋ฑ๋กํด์ผ ์ดํผ์ ํจ๋ ฅ์ด ๋ฐ์ํ๋ค๋ ๊ฒ์ ๋ช
ํํ๊ฒ ํ์๋ค. 2007๋
์ ์ด๋ฃจ์ด์ง ์ 3์ฐจ ๊ฐ์ ์์๋ ๋ถ๋ชจ์ ์๋
๊ด๊ณ ๋ํ ์ ๋ถ๋ฑ๋ก๊ธฐ๊ด์ ๋ฑ๋กํ ๋๋ถํฐ ๋ฒ์ ํจ๋ ฅ์ด ๋ฐ์ํ๋ค๋ ๊ฒ์ ์ ์ค(์ 25์กฐ์ 2ํญ)ํ์๋ค. ๋ํ ๋ฏธ์ฑ๋
์, ๋
ธ๋๋ฅ๋ ฅ ์๋ ์์ ๋ถ์๊ณผ ๊ด๋ จ(์ 37์กฐ์ 2ํญ)ํ์ฌ ๊ธฐ์กด์๋ โ๋ถ์๋ฅ๋ ฅ์ด ์๋ ๊ฐ์ ์ฑ์์ด ์์ ๊ฒฝ์ฐ์๋ ๋ฐ๋ก ์ฌ๋ ๋ถ๋ชจ๋ ์๋
, ์กฐ๋ถ๋ชจ๋ ์์๋
, ํ์ ์๋งค๊ฐ ๋ถ์ํ๋คโ๊ณ ๊ท์ ํ๊ณ ์์๋ ๊ฒ์ โ๋ถ์๋ฅ๋ ฅ์ด ์๋ ๊ฐ์ ์ฑ์์ด ์์ ๊ฒฝ์ฐ์๋ ๋ฐ๋ก ์ฌ๋ ๋ถ๋ชจ๋ ์๋
๊ฐ ๋ถ์ํ๋ฉฐ ๊ทธ๋ค์ด ์์ ๊ฒฝ์ฐ์๋ ์กฐ๋ถ๋ชจ๋ ์์๋
, ํ์ ์๋งค๊ฐ ๋ถ์ํ๋คโ๋ก ๊ฐ์ ํ์๋ค.',
'passage: ํ๊ฒฝ๋งํฌ ์ ๋, ์ธ์ฆ๊ธฐ์ค ๋ณ๊ฒฝ์ผ๋ก ๊ธฐ์
๋ถ๋ด ์ค์ธ๋ค\nํ๊ฒฝ๋งํฌ ์ ๋ ์๊ฐ\nโก ๊ฐ์\nโ ๋์ผ ์ฉ๋์ ๋ค๋ฅธ ์ ํ์ ๋นํด โ์ ํ์ ํ๊ฒฝ์ฑ*โ์ ๊ฐ์ ํ ์ ํ์ ๋ก๊ณ ์ ์ค๋ช
์ ํ์ํ ์ ์๋๋กํ๋ ์ธ์ฆ ์ ๋\nโป ์ ํ์ ํ๊ฒฝ์ฑ : ์ฌ๋ฃ์ ์ ํ์ ์ ์กฐโค์๋น ํ๊ธฐํ๋ ์ ๊ณผ์ ์์ ์ค์ผ๋ฌผ์ง์ด๋ ์จ์ค๊ฐ์ค ๋ฑ์ ๋ฐฐ์ถํ๋ ์ ๋ ๋ฐ ์์๊ณผ ์๋์ง๋ฅผ ์๋นํ๋ ์ ๋ ๋ฑ ํ๊ฒฝ์ ๋ฏธ์น๋ ์ํฅ๋ ฅ์ ์ ๋(ใํ๊ฒฝ๊ธฐ์ ๋ฐ ํ๊ฒฝ์ฐ์
์ง์๋ฒใ์ 2์กฐ์ 5ํธ)\nโก ๋ฒ์ ๊ทผ๊ฑฐ\nโ ใํ๊ฒฝ๊ธฐ์ ๋ฐ ํ๊ฒฝ์ฐ์
์ง์๋ฒใ์ 17์กฐ(ํ๊ฒฝํ์ง์ ์ธ์ฆ)\nโก ๊ด๋ จ ๊ตญ์ ํ์ค\nโ ISO 14024(์ 1์ ํ ํ๊ฒฝ๋ผ๋ฒจ๋ง)\nโก ์ ์ฉ๋์\nโ ์ฌ๋ฌด๊ธฐ๊ธฐ, ๊ฐ์ ์ ํ, ์ํ์ฉํ, ๊ฑด์ถ์์ฌ ๋ฑ 156๊ฐ ๋์์ ํ๊ตฐ\nโก ์ธ์ฆํํฉ\nโ 2,737๊ฐ ๊ธฐ์
์ 16,647๊ฐ ์ ํ(2015.12์๋ง ๊ธฐ์ค)',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
Advanced Usage
import torch.nn.functional as F
from torch import Tensor
from transformers import AutoTokenizer, AutoModel
def average_pool(last_hidden_states: Tensor,
attention_mask: Tensor) -> Tensor:
last_hidden = last_hidden_states.masked_fill(~attention_mask[..., None].bool(), 0.0)
return last_hidden.sum(dim=1) / attention_mask.sum(dim=1)[..., None]
# Each input text should start with "query: " or "passage: ", even for non-English texts.
# For tasks other than retrieval, you can simply use the "query: " prefix.
input_texts = ["query: ๋ถํ๊ฐ์กฑ๋ฒ ๋ช ์ฐจ ๊ฐ์ ์์ ์ดํผํ๊ฒฐ ํ์ ํ 3๊ฐ์ ๋ด์ ๋ฑ๋ก์์๋ง ์ ํจํ๋ค๋ ์กฐํญ์ ํ์คํ ํ์๊น?",
"passage: 1990๋
์ ์ ์ ๋ ๋ถํ ๊ฐ์กฑ๋ฒ์ ์ง๊ธ๊น์ง 4์ฐจ๋ก ๊ฐ์ ๋์ด ํ์ฌ์ ์ด๋ฅด๊ณ ์๋ค. 1993๋
์ ์ด๋ฃจ์ด์ง ์ 1์ฐจ ๊ฐ์ ์ ์ฃผ๋ก ๊ท์ ์ ์ ํ์ฑ์ ๊ธฐํ๊ธฐ ์ํ์ฌ ๋ช๋ช ์กฐ๋ฌธ์ ์์ ํ ๊ฒ์ด๋ฉฐ, ์ค์ฒด์ ์ธ ๋ด์ฉ์ ๋ณด์ํ ๊ฒ์ ์์์ ์น์ธ๊ณผ ํฌ๊ธฐ๊ธฐ๊ฐ์ ์ค์ ํ ์ 52์กฐ ์ ๋๋ผ๊ณ ํ ์ ์๋ค. 2004๋
์ ์ด๋ฃจ์ด์ง ์ 2์ฐจ์ ๊ฐ์ ์์๋ ์ 20์กฐ์ 3ํญ์ ์ ์คํ์ฌ ์ฌํ์ ํ์ ๋ ์ดํผํ๊ฒฐ์ 3๊ฐ์ ๋ด์ ๋ฑ๋กํด์ผ ์ดํผ์ ํจ๋ ฅ์ด ๋ฐ์ํ๋ค๋ ๊ฒ์ ๋ช
ํํ๊ฒ ํ์๋ค. 2007๋
์ ์ด๋ฃจ์ด์ง ์ 3์ฐจ ๊ฐ์ ์์๋ ๋ถ๋ชจ์ ์๋
๊ด๊ณ ๋ํ ์ ๋ถ๋ฑ๋ก๊ธฐ๊ด์ ๋ฑ๋กํ ๋๋ถํฐ ๋ฒ์ ํจ๋ ฅ์ด ๋ฐ์ํ๋ค๋ ๊ฒ์ ์ ์ค(์ 25์กฐ์ 2ํญ)ํ์๋ค. ๋ํ ๋ฏธ์ฑ๋
์, ๋
ธ๋๋ฅ๋ ฅ ์๋ ์์ ๋ถ์๊ณผ ๊ด๋ จ(์ 37์กฐ์ 2ํญ)ํ์ฌ ๊ธฐ์กด์๋ โ๋ถ์๋ฅ๋ ฅ์ด ์๋ ๊ฐ์ ์ฑ์์ด ์์ ๊ฒฝ์ฐ์๋ ๋ฐ๋ก ์ฌ๋ ๋ถ๋ชจ๋ ์๋
, ์กฐ๋ถ๋ชจ๋ ์์๋
, ํ์ ์๋งค๊ฐ ๋ถ์ํ๋คโ๊ณ ๊ท์ ํ๊ณ ์์๋ ๊ฒ์ โ๋ถ์๋ฅ๋ ฅ์ด ์๋ ๊ฐ์ ์ฑ์์ด ์์ ๊ฒฝ์ฐ์๋ ๋ฐ๋ก ์ฌ๋ ๋ถ๋ชจ๋ ์๋
๊ฐ ๋ถ์ํ๋ฉฐ ๊ทธ๋ค์ด ์์ ๊ฒฝ์ฐ์๋ ์กฐ๋ถ๋ชจ๋ ์์๋
, ํ์ ์๋งค๊ฐ ๋ถ์ํ๋คโ๋ก ๊ฐ์ ํ์๋ค.",
"passage: ํ๊ฒฝ๋งํฌ ์ ๋, ์ธ์ฆ๊ธฐ์ค ๋ณ๊ฒฝ์ผ๋ก ๊ธฐ์
๋ถ๋ด ์ค์ธ๋ค\nํ๊ฒฝ๋งํฌ ์ ๋ ์๊ฐ\nโก ๊ฐ์\nโ ๋์ผ ์ฉ๋์ ๋ค๋ฅธ ์ ํ์ ๋นํด โ์ ํ์ ํ๊ฒฝ์ฑ*โ์ ๊ฐ์ ํ ์ ํ์ ๋ก๊ณ ์ ์ค๋ช
์ ํ์ํ ์ ์๋๋กํ๋ ์ธ์ฆ ์ ๋\nโป ์ ํ์ ํ๊ฒฝ์ฑ : ์ฌ๋ฃ์ ์ ํ์ ์ ์กฐโค์๋น ํ๊ธฐํ๋ ์ ๊ณผ์ ์์ ์ค์ผ๋ฌผ์ง์ด๋ ์จ์ค๊ฐ์ค ๋ฑ์ ๋ฐฐ์ถํ๋ ์ ๋ ๋ฐ ์์๊ณผ ์๋์ง๋ฅผ ์๋นํ๋ ์ ๋ ๋ฑ ํ๊ฒฝ์ ๋ฏธ์น๋ ์ํฅ๋ ฅ์ ์ ๋(ใํ๊ฒฝ๊ธฐ์ ๋ฐ ํ๊ฒฝ์ฐ์
์ง์๋ฒใ์ 2์กฐ์ 5ํธ)\nโก ๋ฒ์ ๊ทผ๊ฑฐ\nโ ใํ๊ฒฝ๊ธฐ์ ๋ฐ ํ๊ฒฝ์ฐ์
์ง์๋ฒใ์ 17์กฐ(ํ๊ฒฝํ์ง์ ์ธ์ฆ)\nโก ๊ด๋ จ ๊ตญ์ ํ์ค\nโ ISO 14024(์ 1์ ํ ํ๊ฒฝ๋ผ๋ฒจ๋ง)\nโก ์ ์ฉ๋์\nโ ์ฌ๋ฌด๊ธฐ๊ธฐ, ๊ฐ์ ์ ํ, ์ํ์ฉํ, ๊ฑด์ถ์์ฌ ๋ฑ 156๊ฐ ๋์์ ํ๊ตฐ\nโก ์ธ์ฆํํฉ\nโ 2,737๊ฐ ๊ธฐ์
์ 16,647๊ฐ ์ ํ(2015.12์๋ง ๊ธฐ์ค)"]
tokenizer = AutoTokenizer.from_pretrained('dragonkue/multilingual-e5-small-ko')
model = AutoModel.from_pretrained('dragonkue/multilingual-e5-small-ko')
# Tokenize the input texts
batch_dict = tokenizer(input_texts, max_length=512, padding=True, truncation=True, return_tensors='pt')
outputs = model(**batch_dict)
embeddings = average_pool(outputs.last_hidden_state, batch_dict['attention_mask'])
# normalize embeddings
embeddings = F.normalize(embeddings, p=2, dim=1)
scores = (embeddings[:1] @ embeddings[1:].T)
print(scores.tolist())
๐ Documentation
Model Details
Model Description
Property | Details |
---|---|
Model Type | Sentence Transformer |
Base model | intfloat/multilingual-e5-small |
Maximum Sequence Length | 512 tokens |
Output Dimensionality | 384 dimensions |
Similarity Function | Cosine Similarity |
Training Datasets | - |
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
(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})
(2): Normalize()
)
๐ง Technical Details
Evaluation
- This evaluation references the KURE GitHub repository. (https://github.com/nlpai-lab/KURE)
- We conducted an evaluation on all Korean Retrieval Benchmarks registered in MTEB.
Korean Retrieval Benchmark
- Ko-StrategyQA: A Korean ODQA multi-hop retrieval dataset, translated from StrategyQA.
- AutoRAGRetrieval: A Korean document retrieval dataset constructed by parsing PDFs from five domains: finance, public, medical, legal, and commerce.
- MIRACLRetrieval: A Korean document retrieval dataset based on Wikipedia.
- PublicHealthQA: A retrieval dataset focused on medical and public health domains in Korean.
- BelebeleRetrieval: A Korean document retrieval dataset based on FLORES - 200.
- MrTidyRetrieval: A Wikipedia-based Korean document retrieval dataset.
- XPQARetrieval: A cross-domain Korean document retrieval dataset.
Metrics
- Standard metric : NDCG@10
Information Retrieval
Model | Size(M) | Average | XPQARetrieval | PublicHealthQA | MIRACLRetrieval | Ko-StrategyQA | BelebeleRetrieval | AutoRAGRetrieval | MrTidyRetrieval |
---|---|---|---|---|---|---|---|---|---|
BAAI/bge-m3 | 560 | 0.724169 | 0.36075 | 0.80412 | 0.70146 | 0.79405 | 0.93164 | 0.83008 | 0.64708 |
Snowflake/snowflake-arctic-embed-l-v2.0 | 560 | 0.724104 | 0.43018 | 0.81679 | 0.66077 | 0.80455 | 0.9271 | 0.83863 | 0.59071 |
intfloat/multilingual-e5-large | 560 | 0.721607 | 0.3571 | 0.82534 | 0.66486 | 0.80348 | 0.94499 | 0.81337 | 0.64211 |
intfloat/multilingual-e5-base | 278 | 0.689429 | 0.3607 | 0.77203 | 0.6227 | 0.76355 | 0.92868 | 0.79752 | 0.58082 |
dragonkue/multilingual-e5-small-ko | 118 | 0.688819 | 0.34871 | 0.79729 | 0.61113 | 0.76173 | 0.9297 | 0.86184 | 0.51133 |
intfloat/multilingual-e5-small | 118 | 0.670906 | 0.33003 | 0.73668 | 0.61238 | 0.75157 | 0.90531 | 0.80068 | 0.55969 |
ibm-granite/granite-embedding-278m-multilingual | 278 | 0.616466 | 0.23058 | 0.77668 | 0.59216 | 0.71762 | 0.83231 | 0.70226 | 0.46365 |
ibm-granite/granite-embedding-107m-multilingual | 107 | 0.599759 | 0.23058 | 0.73209 | 0.58413 | 0.70531 | 0.82063 | 0.68243 | 0.44314 |
sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 | 118 | 0.409766 | 0.21345 | 0.67409 | 0.25676 | 0.45903 | 0.71491 | 0.42296 | 0.12716 |
Performance Comparison by Model Size (Based on Average NDCG@10)
Training Details
Training Datasets
This model was fine - tuned on the same dataset used in dragonkue/snowflake-arctic-embed-l-v2.0-ko, which consists of Korean query - passage pairs. The training objective was to improve retrieval performance specifically for Korean - language tasks.
Training Methods
Following the training approach used in dragonkue/snowflake-arctic-embed-l-v2.0-ko, this model constructs in - batch negatives based on clustered passages. In addition, we introduce GISTEmbedLoss with a configurable margin.
๐ Margin - based Training Results
- Using the standard MNR (Multiple Negatives Ranking) loss alone resulted in decreased performance.
- The original GISTEmbedLoss (without margin) yielded modest improvements of around +0.8 NDCG@10.
- Applying a margin led to performance gains of up to +1.5 NDCG@10.
- This indicates that simply tuning the margin value can lead to up to 2x improvement, showing strong sensitivity and effectiveness of margin scaling.
This margin - based approach extends the idea proposed in the NV - Retriever paper, which originally filtered false negatives during hard negative sampling. We adapt this to in - batch negatives, treating false negatives as dynamic samples guided by margin - based filtering.
The sentence - transformers library now supports GISTEmbedLoss with margin configuration, making it easy to integrate into any training pipeline.
You can install the latest version with:
pip install -U sentence-transformers
Training Hyperparameters
Non - Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 20000per_device_eval_batch_size
: 4096learning_rate
: 0.00025num_train_epochs
: 3warmup_ratio
: 0.05fp16
: Truedataloader_drop_last
: Truebatch_sampler
: no_duplicates
All Hyperparameters
Click to expand
ove
๐ License
This model is licensed under the apache - 2.0 license.





