upskyy / ko-reranker

huggingface.co
Total runs: 19
24-hour runs: 0
7-day runs: -1
30-day runs: -35
Model's Last Updated: April 06 2025
text-ranking

Introduction of ko-reranker

Model Details of ko-reranker

upskyy/ko-reranker

ko-reranker 는 BAAI/bge-reranker-large 모델에 한국어 데이터 를 finetuning 한 model 입니다.

Usage
Using FlagEmbedding
pip install -U FlagEmbedding

Get relevance scores (higher scores indicate more relevance):

from FlagEmbedding import FlagReranker


reranker = FlagReranker('upskyy/ko-reranker', use_fp16=True) # Setting use_fp16 to True speeds up computation with a slight performance degradation

score = reranker.compute_score(['query', 'passage'])
print(score) # -1.861328125

# You can map the scores into 0-1 by set "normalize=True", which will apply sigmoid function to the score
score = reranker.compute_score(['query', 'passage'], normalize=True)
print(score) # 0.13454832326359276

scores = reranker.compute_score([['what is panda?', 'hi'], ['what is panda?', 'The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear or simply panda, is a bear species endemic to China.']])
print(scores) # [-7.37109375, 8.5390625]

# You can map the scores into 0-1 by set "normalize=True", which will apply sigmoid function to the score
scores = reranker.compute_score([['what is panda?', 'hi'], ['what is panda?', 'The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear or simply panda, is a bear species endemic to China.']], normalize=True)
print(scores) # [0.0006287840192903181, 0.9998043646624727]
Using Sentence-Transformers
pip install -U sentence-transformers

Get relevance scores (higher scores indicate more relevance):

from sentence_transformers import SentenceTransformer


sentences_1 = ["경제 전문가가 금리 인하에 대한 예측을 하고 있다.", "주식 시장에서 한 투자자가 주식을 매수한다."]
sentences_2 = ["한 투자자가 비트코인을 매수한다.", "금융 거래소에서 새로운 디지털 자산이 상장된다."]

model = SentenceTransformer('upskyy/ko-reranker')

embeddings_1 = model.encode(sentences_1, normalize_embeddings=True)
embeddings_2 = model.encode(sentences_2, normalize_embeddings=True)
similarity = embeddings_1 @ embeddings_2.T

print(similarity)
Using Huggingface transformers

Get relevance scores (higher scores indicate more relevance):

import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer


tokenizer = AutoTokenizer.from_pretrained('upskyy/ko-reranker')
model = AutoModelForSequenceClassification.from_pretrained('upskyy/ko-reranker')
model.eval()

pairs = [['what is panda?', 'hi'], ['what is panda?', 'The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear or simply panda, is a bear species endemic to China.']]

with torch.no_grad():
    inputs = tokenizer(pairs, padding=True, truncation=True, return_tensors='pt', max_length=512)
    scores = model(**inputs, return_dict=True).logits.view(-1, ).float()
    print(scores)
Citation
@misc{bge_embedding,
      title={C-Pack: Packaged Resources To Advance General Chinese Embedding}, 
      author={Shitao Xiao and Zheng Liu and Peitian Zhang and Niklas Muennighoff},
      year={2023},
      eprint={2309.07597},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
License

FlagEmbedding is licensed under the MIT License. The released models can be used for commercial purposes free of charge.

Runs of upskyy ko-reranker on huggingface.co

19
Total runs
0
24-hour runs
0
3-day runs
-1
7-day runs
-35
30-day runs

More Information About ko-reranker huggingface.co Model

More ko-reranker license Visit here:

https://choosealicense.com/licenses/mit

ko-reranker huggingface.co

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

ko-reranker huggingface.co Url

https://huggingface.co/upskyy/ko-reranker

upskyy ko-reranker online free

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

upskyy ko-reranker online free url in huggingface.co:

https://huggingface.co/upskyy/ko-reranker

ko-reranker install

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

ko-reranker install url in huggingface.co:

https://huggingface.co/upskyy/ko-reranker

Url of ko-reranker

ko-reranker huggingface.co Url

Provider of ko-reranker huggingface.co

upskyy
ORGANIZATIONS

Other API from upskyy

huggingface.co

Total runs: 32.3K
Run Growth: -11.7K
Growth Rate: -36.30%
Updated:August 09 2024
huggingface.co

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

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