Text Ranking
sentence-transformers
ONNX
Safetensors
Transformers.js
modernbert
text-classification
reranker
cross-encoder
rerank
rag
retrieval
chinese
japanese
korean
langchain
llamaindex
haystack
text-embeddings-inference
Instructions to use CheezOne/reranker-cjk-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use CheezOne/reranker-cjk-small with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("CheezOne/reranker-cjk-small") 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) - Transformers.js
How to use CheezOne/reranker-cjk-small with Transformers.js:
// npm i @huggingface/transformers import { AutoTokenizer, AutoModelForSequenceClassification } from '@huggingface/transformers'; const tokenizer = await AutoTokenizer.from_pretrained('CheezOne/reranker-cjk-small'); const model = await AutoModelForSequenceClassification.from_pretrained('CheezOne/reranker-cjk-small'); const query = 'Which planet is known as the Red Planet?'; const documents = [ 'Mars, known for its reddish appearance, is often referred to as the Red Planet.', 'Venus is often called the twin of Earth because of its similar size and proximity.', ]; const inputs = tokenizer(new Array(documents.length).fill(query), { text_pair: documents, padding: true, truncation: true }); const { logits } = await model(inputs); console.log(logits.sigmoid().tolist()); // one relevance score per document - Notebooks
- Google Colab
- Kaggle
Update links to renamed models (-cjk-small)
Browse files
README.md
CHANGED
|
@@ -47,7 +47,7 @@ Notes, so you can judge the numbers yourself:
|
|
| 47 |
### sentence-transformers
|
| 48 |
```python
|
| 49 |
from sentence_transformers import CrossEncoder
|
| 50 |
-
model = CrossEncoder("CheezOne/reranker-
|
| 51 |
query = "如何办理护照?"
|
| 52 |
passages = ["办理护照需要携带身份证和户口本到出入境管理局申请。", "护照是一种旅行证件。", "今天北京天气晴朗。"]
|
| 53 |
print(model.rank(query, passages))
|
|
@@ -57,8 +57,8 @@ print(model.rank(query, passages))
|
|
| 57 |
```python
|
| 58 |
import torch
|
| 59 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 60 |
-
tok = AutoTokenizer.from_pretrained("CheezOne/reranker-
|
| 61 |
-
model = AutoModelForSequenceClassification.from_pretrained("CheezOne/reranker-
|
| 62 |
pairs = [["東京タワーの高さは?", "東京タワーの高さは333メートルです。"], ["東京タワーの高さは?", "大阪城は豊臣秀吉が築いた城です。"]]
|
| 63 |
enc = tok(pairs, padding=True, truncation=True, max_length=512, return_tensors="pt")
|
| 64 |
with torch.no_grad():
|
|
@@ -69,8 +69,8 @@ Scores are raw logits; apply `sigmoid` if you want values in 0–1.
|
|
| 69 |
### transformers.js (browser / Node)
|
| 70 |
```js
|
| 71 |
import { AutoTokenizer, AutoModelForSequenceClassification } from "@huggingface/transformers";
|
| 72 |
-
const tok = await AutoTokenizer.from_pretrained("CheezOne/reranker-
|
| 73 |
-
const model = await AutoModelForSequenceClassification.from_pretrained("CheezOne/reranker-
|
| 74 |
const inputs = tok(["빨간 물약", "빨간 물약"], { text_pair: ["체력을 회복하는 빨간 물약입니다.", "서울은 한국의 수도입니다."], padding: true, truncation: true });
|
| 75 |
console.log((await model(inputs)).logits.data);
|
| 76 |
```
|
|
@@ -111,7 +111,7 @@ Data: T2Ranking, Mr. TyDi; evaluation: MIRACL (via MTEB).
|
|
| 111 |
|
| 112 |
## Use it in your project
|
| 113 |
|
| 114 |
-
- **Model id** (paste as-is): `CheezOne/reranker-
|
| 115 |
- **License**: Apache-2.0 (see `LICENSE`). You may depend on it, redistribute it and fine-tune it, including commercially. Please keep the attribution.
|
| 116 |
- If this model helps your project, a mention of the model id in your README lets other people find it.
|
| 117 |
|
|
@@ -120,7 +120,7 @@ Data: T2Ranking, Mr. TyDi; evaluation: MIRACL (via MTEB).
|
|
| 120 |
title = {Small multilingual reranker for Chinese, Japanese and Korean},
|
| 121 |
author = {CheezOne},
|
| 122 |
year = {2026},
|
| 123 |
-
howpublished = {\url{https://huggingface.co/CheezOne/reranker-
|
| 124 |
}
|
| 125 |
```
|
| 126 |
|
|
@@ -128,6 +128,6 @@ Data: T2Ranking, Mr. TyDi; evaluation: MIRACL (via MTEB).
|
|
| 128 |
|
| 129 |
Small open models for Chinese / Japanese / Korean / English apps. All of them run on CPU, and most in the browser.
|
| 130 |
|
| 131 |
-
- [pii-detector-
|
| 132 |
- [prompt-injection-jailbreak-detector-chinese-japanese-korean-english](https://huggingface.co/CheezOne/prompt-injection-jailbreak-detector-chinese-japanese-korean-english): Prompt-injection / jailbreak detector (zh/ja/ko/en): a guardrail for LLM apps
|
| 133 |
- [pixel-art-sprite-generator-16x16](https://huggingface.co/CheezOne/pixel-art-sprite-generator-16x16): Pixel sprite generator: text → 16×16 game sprites, in your browser ([demo](https://huggingface.co/spaces/CheezOne/pixel-art-sprite-generator-demo))
|
|
|
|
| 47 |
### sentence-transformers
|
| 48 |
```python
|
| 49 |
from sentence_transformers import CrossEncoder
|
| 50 |
+
model = CrossEncoder("CheezOne/reranker-cjk-small")
|
| 51 |
query = "如何办理护照?"
|
| 52 |
passages = ["办理护照需要携带身份证和户口本到出入境管理局申请。", "护照是一种旅行证件。", "今天北京天气晴朗。"]
|
| 53 |
print(model.rank(query, passages))
|
|
|
|
| 57 |
```python
|
| 58 |
import torch
|
| 59 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 60 |
+
tok = AutoTokenizer.from_pretrained("CheezOne/reranker-cjk-small")
|
| 61 |
+
model = AutoModelForSequenceClassification.from_pretrained("CheezOne/reranker-cjk-small").eval()
|
| 62 |
pairs = [["東京タワーの高さは?", "東京タワーの高さは333メートルです。"], ["東京タワーの高さは?", "大阪城は豊臣秀吉が築いた城です。"]]
|
| 63 |
enc = tok(pairs, padding=True, truncation=True, max_length=512, return_tensors="pt")
|
| 64 |
with torch.no_grad():
|
|
|
|
| 69 |
### transformers.js (browser / Node)
|
| 70 |
```js
|
| 71 |
import { AutoTokenizer, AutoModelForSequenceClassification } from "@huggingface/transformers";
|
| 72 |
+
const tok = await AutoTokenizer.from_pretrained("CheezOne/reranker-cjk-small");
|
| 73 |
+
const model = await AutoModelForSequenceClassification.from_pretrained("CheezOne/reranker-cjk-small", { dtype: "q8" });
|
| 74 |
const inputs = tok(["빨간 물약", "빨간 물약"], { text_pair: ["체력을 회복하는 빨간 물약입니다.", "서울은 한국의 수도입니다."], padding: true, truncation: true });
|
| 75 |
console.log((await model(inputs)).logits.data);
|
| 76 |
```
|
|
|
|
| 111 |
|
| 112 |
## Use it in your project
|
| 113 |
|
| 114 |
+
- **Model id** (paste as-is): `CheezOne/reranker-cjk-small`
|
| 115 |
- **License**: Apache-2.0 (see `LICENSE`). You may depend on it, redistribute it and fine-tune it, including commercially. Please keep the attribution.
|
| 116 |
- If this model helps your project, a mention of the model id in your README lets other people find it.
|
| 117 |
|
|
|
|
| 120 |
title = {Small multilingual reranker for Chinese, Japanese and Korean},
|
| 121 |
author = {CheezOne},
|
| 122 |
year = {2026},
|
| 123 |
+
howpublished = {\url{https://huggingface.co/CheezOne/reranker-cjk-small}}
|
| 124 |
}
|
| 125 |
```
|
| 126 |
|
|
|
|
| 128 |
|
| 129 |
Small open models for Chinese / Japanese / Korean / English apps. All of them run on CPU, and most in the browser.
|
| 130 |
|
| 131 |
+
- [pii-detector-cjk-small](https://huggingface.co/CheezOne/pii-detector-cjk-small): PII detector (zh/ja/ko/en): find and redact names, phones, IDs, addresses. ONNX, runs on CPU and in the browser
|
| 132 |
- [prompt-injection-jailbreak-detector-chinese-japanese-korean-english](https://huggingface.co/CheezOne/prompt-injection-jailbreak-detector-chinese-japanese-korean-english): Prompt-injection / jailbreak detector (zh/ja/ko/en): a guardrail for LLM apps
|
| 133 |
- [pixel-art-sprite-generator-16x16](https://huggingface.co/CheezOne/pixel-art-sprite-generator-16x16): Pixel sprite generator: text → 16×16 game sprites, in your browser ([demo](https://huggingface.co/spaces/CheezOne/pixel-art-sprite-generator-demo))
|