upskyy / bge-m3-korean

huggingface.co
Total runs: 31.3K
24-hour runs: -1.3K
7-day runs: -3.0K
30-day runs: -13.1K
Model's Last Updated: August 09 2024
sentence-similarity

Introduction of bge-m3-korean

Model Details of bge-m3-korean

upskyy/bge-m3-korean

This model is korsts and kornli finetuning model from BAAI/bge-m3 . It maps sentences & paragraphs to a 1024-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: BAAI/bge-m3
  • Maximum Sequence Length: 8192 tokens
  • Output Dimensionality: 1024 tokens
  • Similarity Function: Cosine Similarity
Full Model Architecture
SentenceTransformer(
  (0): Transformer({'max_seq_length': 8192, 'do_lower_case': False}) with Transformer model: XLMRobertaModel 
  (1): Pooling({'word_embedding_dimension': 1024, '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/bge-m3-korean")

# Run inference
sentences = [
    '์•„์ด๋ฅผ ๊ฐ€์ง„ ์—„๋งˆ๊ฐ€ ํ•ด๋ณ€์„ ๊ฑท๋Š”๋‹ค.',
    '๋‘ ์‚ฌ๋žŒ์ด ํ•ด๋ณ€์„ ๊ฑท๋Š”๋‹ค.',
    'ํ•œ ๋‚จ์ž๊ฐ€ ํ•ด๋ณ€์—์„œ ๊ฐœ๋ฅผ ์‚ฐ์ฑ…์‹œํ‚จ๋‹ค.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
print(similarities)
# tensor([[1.0000, 0.6173, 0.3672],
#         [0.6173, 1.0000, 0.4775],
#         [0.3672, 0.4775, 1.0000]])
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/bge-m3-korean")
model = AutoModel.from_pretrained("upskyy/bge-m3-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.874
spearman_cosine 0.8724
pearson_manhattan 0.8593
spearman_manhattan 0.8688
pearson_euclidean 0.8598
spearman_euclidean 0.8694
pearson_dot 0.8684
spearman_dot 0.8666
pearson_max 0.874
spearman_max 0.8724
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
@misc{bge-m3,
      title={BGE M3-Embedding: Multi-Lingual, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation}, 
      author={Jianlv Chen and Shitao Xiao and Peitian Zhang and Kun Luo and Defu Lian and Zheng Liu},
      year={2024},
      eprint={2402.03216},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
@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",
}

Runs of upskyy bge-m3-korean on huggingface.co

31.3K
Total runs
-1.3K
24-hour runs
-3.6K
3-day runs
-3.0K
7-day runs
-13.1K
30-day runs

More Information About bge-m3-korean huggingface.co Model

bge-m3-korean huggingface.co

bge-m3-korean huggingface.co is an AI model on huggingface.co that provides bge-m3-korean's model effect (), which can be used instantly with this upskyy bge-m3-korean model. huggingface.co supports a free trial of the bge-m3-korean model, and also provides paid use of the bge-m3-korean. Support call bge-m3-korean model through api, including Node.js, Python, http.

bge-m3-korean huggingface.co Url

https://huggingface.co/upskyy/bge-m3-korean

upskyy bge-m3-korean online free

bge-m3-korean huggingface.co is an online trial and call api platform, which integrates bge-m3-korean's modeling effects, including api services, and provides a free online trial of bge-m3-korean, you can try bge-m3-korean online for free by clicking the link below.

upskyy bge-m3-korean online free url in huggingface.co:

https://huggingface.co/upskyy/bge-m3-korean

bge-m3-korean install

bge-m3-korean is an open source model from GitHub that offers a free installation service, and any user can find bge-m3-korean on GitHub to install. At the same time, huggingface.co provides the effect of bge-m3-korean install, users can directly use bge-m3-korean installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

bge-m3-korean install url in huggingface.co:

https://huggingface.co/upskyy/bge-m3-korean

Url of bge-m3-korean

bge-m3-korean huggingface.co Url

Provider of bge-m3-korean huggingface.co

upskyy
ORGANIZATIONS

Other API from upskyy

huggingface.co

Total runs: 2.1K
Run Growth: 2.1K
Growth Rate: 98.39%
Updated:August 09 2024
huggingface.co

Total runs: 19
Run Growth: -35
Growth Rate: -184.21%
Updated:April 06 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:August 24 2024