Files
e5-small-korean/README.md
ModelHub XC 410b13fcc5 初始化项目,由ModelHub XC社区提供模型
Model: upskyy/e5-small-korean
Source: Original Platform
2026-11-01 14:16:18 +08:00

9.5 KiB

language, license, library_name, tags, base_model, datasets, metrics, widget, pipeline_tag, model-index
language license library_name tags base_model datasets metrics widget pipeline_tag model-index
multilingual
af
am
ar
as
az
be
bg
bn
br
bs
ca
cs
cy
da
de
el
en
eo
es
et
eu
fa
fi
fr
fy
ga
gd
gl
gu
ha
he
hi
hr
hu
hy
id
is
it
ja
jv
ka
kk
km
kn
ko
ku
ky
la
lo
lt
lv
mg
mk
ml
mn
mr
ms
my
ne
nl
no
om
or
pa
pl
ps
pt
ro
ru
sa
sd
si
sk
sl
so
sq
sr
su
sv
sw
ta
te
th
tl
tr
ug
uk
ur
uz
vi
xh
yi
zh
mit sentence-transformers
korean
sentence-transformers
transformers
multilingual
sentence-transformers
sentence-similarity
feature-extraction
intfloat/multilingual-e5-small
pearson_cosine
spearman_cosine
pearson_manhattan
spearman_manhattan
pearson_euclidean
spearman_euclidean
pearson_dot
spearman_dot
pearson_max
spearman_max
source_sentence sentences
이집트 군대가 형제애를 단속하다
이집트의 군대가 무슬림 형제애를 단속하다
아르헨티나의 기예르모 코리아와 네덜란드의 마틴 버커크의 또 다른 준결승전도 매력적이다.
그것이 사실일 수도 있다고 생각하는 것은 재미있다.
source_sentence sentences
오, 그리고 다시 결혼은 근본적인 인권이라고 주장한다.
특히 결혼은 근본적인 인권이라고 말한 후에.
해변에 있는 흑인과 그의 개...
이란은 핵 프로그램이 평화적인 목적을 위한 것이라고 주장한다
source_sentence sentences
한 소년이 파란 플라스틱 슬라이드 위에서 뛰어내린다.
아이들이 놀고 있다
한 소년이 빨간 플라스틱 사다리 꼭대기에서 뛰어내린다.
슬라이드가 있다.
source_sentence sentences
감각주의자들은 일부러 오르가즘 없이 섹스를 한다. 그녀는 촛불을 좋아하고, 몸에 기름을 바른 히보스에 대해 쓰고 있다.
감각주의자들은 섹스하는 동안 오르가즘을 느끼고 싶어한다.
하지만 밤마다 드로잉을 하는 것보다 전국적으로 방송되는 대질심문을 하는 것이 훨씬 더 힘든 일이다, 그래서 미스.
감각주의자들은 일부러 오르가즘 없이 섹스를 한다.
source_sentence sentences
조지 샤힌은 안데르센 컨설팅 사업부에서 일했다.
심장 박동이 빨라졌다.
안데르센 컨설팅은 여전히 번창하는 사업이다.
이것은 내가 영국의 아서 안데르센 사업부의 파트너인 짐 와디아를 아서 안데르센 경영진이 선택한 것보다 래리 웨인바흐를 안데르센 월드와이드의 경영 파트너로 승계하기 위해 안데르센 컨설팅 사업부(현재의 엑센츄어라고 알려져 있음)의 전 관리 파트너인 조지 샤힌에 대한 지지를 표명했을 때 가장 명백했다.
sentence-similarity
name results
upskyy/e5-small-korean
task dataset metrics
type name
semantic-similarity Semantic Similarity
name type
sts dev sts-dev
type value name
pearson_cosine 0.8479945412588525 Pearson Cosine
type value name
spearman_cosine 0.8466656037931976 Spearman Cosine
type value name
pearson_manhattan 0.8309207821128262 Pearson Manhattan
type value name
spearman_manhattan 0.8372540023545114 Spearman Manhattan
type value name
pearson_euclidean 0.8328087877425099 Pearson Euclidean
type value name
spearman_euclidean 0.8395342346643203 Spearman Euclidean
type value name
pearson_dot 0.8212157223150336 Pearson Dot
type value name
spearman_dot 0.8225569441483638 Spearman Dot
type value name
pearson_max 0.8479945412588525 Pearson Max
type value name
spearman_max 0.8466656037931976 Spearman Max

upskyy/e5-small-korean

This model is korsts and kornli finetuning model from 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.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: intfloat/multilingual-e5-small
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 384 tokens
  • Similarity Function: Cosine Similarity

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})
)

Usage

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("upskyy/e5-small-korean")

# Run inference
sentences = [
    '아이를 가진 엄마가 해변을 걷는다.',
    '두 사람이 해변을 걷는다.',
    '한 남자가 해변에서 개를 산책시킨다.',
]
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]

Usage (HuggingFace Transformers)

Without sentence-transformers, you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.

from transformers import AutoTokenizer, AutoModel
import torch


# Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
    token_embeddings = model_output[0] # First element of model_output contains all token embeddings
    input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
    return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)


# Sentences we want sentence embeddings for
sentences = ["안녕하세요?", "한국어 문장 임베딩을 위한 버트 모델입니다."]

# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained("upskyy/e5-small-korean")
model = AutoModel.from_pretrained("upskyy/e5-small-korean")

# Tokenize sentences
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors="pt")

# Compute token embeddings
with torch.no_grad():
    model_output = model(**encoded_input)

# Perform pooling. In this case, mean pooling.
sentence_embeddings = mean_pooling(model_output, encoded_input["attention_mask"])

print("Sentence embeddings:")
print(sentence_embeddings)

Evaluation

Metrics

Semantic Similarity

Metric Value
pearson_cosine 0.848
spearman_cosine 0.8467
pearson_manhattan 0.8309
spearman_manhattan 0.8373
pearson_euclidean 0.8328
spearman_euclidean 0.8395
pearson_dot 0.8212
spearman_dot 0.8226
pearson_max 0.848
spearman_max 0.8467

Framework Versions

  • Python: 3.10.13
  • Sentence Transformers: 3.0.1
  • Transformers: 4.42.4
  • PyTorch: 2.3.0+cu121
  • Accelerate: 0.30.1
  • Datasets: 2.16.1
  • Tokenizers: 0.19.1

Citation

BibTeX

@article{wang2024multilingual,
  title={Multilingual E5 Text Embeddings: A Technical Report},
  author={Wang, Liang and Yang, Nan and Huang, Xiaolong and Yang, Linjun and Majumder, Rangan and Wei, Furu},
  journal={arXiv preprint arXiv:2402.05672},
  year={2024}
}
@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",
}