Instructions to use tencent/R3-rerank-0.6b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use tencent/R3-rerank-0.6b with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("tencent/R3-rerank-0.6b") 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) - Notebooks
- Google Colab
- Kaggle
Expand code snippet for easier use + add missing tag
#1
by tomaarsen HF Staff - opened
README.md
CHANGED
|
@@ -3,6 +3,7 @@ license: apache-2.0
|
|
| 3 |
base_model: Qwen/Qwen3-Reranker-0.6B
|
| 4 |
pipeline_tag: text-ranking
|
| 5 |
tags:
|
|
|
|
| 6 |
- cross-encoder
|
| 7 |
- agent-skill-retrieval
|
| 8 |
---
|
|
@@ -22,8 +23,17 @@ scores each (query, skill) pair jointly, paired with
|
|
| 22 |
```python
|
| 23 |
from sentence_transformers import CrossEncoder
|
| 24 |
|
| 25 |
-
model = CrossEncoder("tencent/R3-rerank-0.6b"
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
```
|
| 28 |
|
| 29 |
## Citation
|
|
|
|
| 3 |
base_model: Qwen/Qwen3-Reranker-0.6B
|
| 4 |
pipeline_tag: text-ranking
|
| 5 |
tags:
|
| 6 |
+
- sentence-transformers
|
| 7 |
- cross-encoder
|
| 8 |
- agent-skill-retrieval
|
| 9 |
---
|
|
|
|
| 23 |
```python
|
| 24 |
from sentence_transformers import CrossEncoder
|
| 25 |
|
| 26 |
+
model = CrossEncoder("tencent/R3-rerank-0.6b")
|
| 27 |
+
query = "I need to compose music"
|
| 28 |
+
skills = [ # The format is "name | description | skill_md"
|
| 29 |
+
"music-composer | Composes original music | Creates music for various media formats ...",
|
| 30 |
+
"music-lyricist | Writes lyrics for songs | Creates lyrics for various music genres ...",
|
| 31 |
+
"music-editor | Edits and mixes music tracks | Provides audio editing and mixing services ...",
|
| 32 |
+
]
|
| 33 |
+
pairs = [(query, skill) for skill in skills]
|
| 34 |
+
scores = model.predict(pairs)
|
| 35 |
+
print(scores)
|
| 36 |
+
# [ 0.34937477 -1.7738094 -1.6604462 ]
|
| 37 |
```
|
| 38 |
|
| 39 |
## Citation
|