Text Ranking
sentence-transformers
Safetensors
Korean
English
modernbert
cross-encoder
reranker
korean
english
text-embeddings-inference
Instructions to use nlpai-lab/KURE-Reranker-nano with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use nlpai-lab/KURE-Reranker-nano with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("nlpai-lab/KURE-Reranker-nano") query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Inference
- Notebooks
- Google Colab
- Kaggle
Add API usage
Browse files
README.md
CHANGED
|
@@ -21,7 +21,7 @@ tags:
|
|
| 21 |
|
| 22 |
# KURE-Reranker-nano
|
| 23 |
|
| 24 |
-
**KURE-Reranker-nano** is a lightweight, approximately **150M-parameter** Korean-English bilingual reranker. It jointly encodes a query and a candidate document and predicts a scalar relevance score.
|
| 25 |
|
| 26 |
## Key Characteristics
|
| 27 |
|
|
@@ -112,6 +112,39 @@ for index in torch.argsort(scores, descending=True).tolist():
|
|
| 112 |
|
| 113 |
</details>
|
| 114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
## Korean Reranking Evaluation
|
| 116 |
|
| 117 |
Scores are **nDCG@10**, and throughput is pairs per second (**PPS**).
|
|
|
|
| 21 |
|
| 22 |
# KURE-Reranker-nano
|
| 23 |
|
| 24 |
+
**KURE-Reranker-nano** is a lightweight, approximately **150M-parameter** Korean-English bilingual reranker. It jointly encodes a query and a candidate document and predicts a scalar relevance score. It is also served through the [KURE API](https://kure.kullm.ai/).
|
| 25 |
|
| 26 |
## Key Characteristics
|
| 27 |
|
|
|
|
| 112 |
|
| 113 |
</details>
|
| 114 |
|
| 115 |
+
<details>
|
| 116 |
+
<summary>API</summary>
|
| 117 |
+
|
| 118 |
+
KURE-Reranker-nano is served at [kure.kullm.ai](https://kure.kullm.ai/). Sign in with GitHub there to get an API key.
|
| 119 |
+
|
| 120 |
+
```python
|
| 121 |
+
import os
|
| 122 |
+
|
| 123 |
+
import requests
|
| 124 |
+
|
| 125 |
+
query = "λνλ―Όκ΅μ μλλ μ΄λμΈκ°μ?"
|
| 126 |
+
documents = [
|
| 127 |
+
"λνλ―Όκ΅μ μλλ μμΈμ
λλ€.",
|
| 128 |
+
"The capital of South Korea is Seoul.",
|
| 129 |
+
"λ°λλλ μ΄λ μ§μμμ μ¬λ°°λλ κ³ΌμΌμ
λλ€.",
|
| 130 |
+
]
|
| 131 |
+
|
| 132 |
+
# Results come sorted by relevance_score (sigmoid of the logit, 0 to 1). top_n keeps only the best N
|
| 133 |
+
response = requests.post(
|
| 134 |
+
"https://kure.kullm.ai/api/v1/rerank",
|
| 135 |
+
headers={"Authorization": f"Bearer {os.environ['KURE_API_KEY']}"},
|
| 136 |
+
json={"model": "kure-reranker-nano", "query": query, "documents": documents, "return_documents": True},
|
| 137 |
+
)
|
| 138 |
+
response.raise_for_status()
|
| 139 |
+
for result in response.json()["results"]:
|
| 140 |
+
print(f"{result['relevance_score']:.4f}\t{result['document']['text']}")
|
| 141 |
+
# 0.9984 λνλ―Όκ΅μ μλλ μμΈμ
λλ€.
|
| 142 |
+
# 0.8661 The capital of South Korea is Seoul.
|
| 143 |
+
# 0.0000 λ°λλλ μ΄λ μ§μμμ μ¬λ°°λλ κ³ΌμΌμ
λλ€.
|
| 144 |
+
```
|
| 145 |
+
|
| 146 |
+
</details>
|
| 147 |
+
|
| 148 |
## Korean Reranking Evaluation
|
| 149 |
|
| 150 |
Scores are **nDCG@10**, and throughput is pairs per second (**PPS**).
|