Instructions to use zeroentropy/zerank-1-small-reranker with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use zeroentropy/zerank-1-small-reranker with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("zeroentropy/zerank-1-small-reranker") 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
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,19 +1,34 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
base_model:
|
| 3 |
- Qwen/Qwen3-4B
|
| 4 |
-
pipeline_tag:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
---
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
-
This is a smaller version of ZeroEntropy Reranker v0.3.
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
```python
|
| 14 |
from sentence_transformers import CrossEncoder
|
| 15 |
|
| 16 |
-
model = CrossEncoder("zeroentropy/
|
| 17 |
|
| 18 |
query_documents = [
|
| 19 |
("What is 2+2?", "4"),
|
|
@@ -22,4 +37,34 @@ query_documents = [
|
|
| 22 |
|
| 23 |
scores = model.predict(query_documents)
|
| 24 |
|
| 25 |
-
print(scores)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: cc-by-nc-4.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
base_model:
|
| 6 |
- Qwen/Qwen3-4B
|
| 7 |
+
pipeline_tag: text-ranking
|
| 8 |
+
tags:
|
| 9 |
+
- finance
|
| 10 |
+
- legal
|
| 11 |
+
- code
|
| 12 |
+
- stem
|
| 13 |
+
- medical
|
| 14 |
---
|
| 15 |
+
# zerank-1: ZeroEntropy Inc.'s SoTA reranker
|
| 16 |
|
| 17 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
| 18 |
|
|
|
|
| 19 |
|
| 20 |
+
This model is the smaller version of [zeroentropy/zerank-1](https://huggingface.co/zeroentropy/zerank-1). This model is over 2x smaller, but maintains nearly the same standard of performance, continuing to outperform other popular rerankers.
|
| 21 |
+
|
| 22 |
+
It is an open-weights reranker model meant to be integrated into RAG applications to rerank results from preliminary search methods such as embeddings, BM25, and hybrid search.
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
## How to Use
|
| 27 |
|
| 28 |
```python
|
| 29 |
from sentence_transformers import CrossEncoder
|
| 30 |
|
| 31 |
+
model = CrossEncoder("zeroentropy/zerank-1-small", trust_remote_code=True)
|
| 32 |
|
| 33 |
query_documents = [
|
| 34 |
("What is 2+2?", "4"),
|
|
|
|
| 37 |
|
| 38 |
scores = model.predict(query_documents)
|
| 39 |
|
| 40 |
+
print(scores)
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Evaluations
|
| 44 |
+
|
| 45 |
+
Comparing NDCG@10 starting from top 100 documents by embedding (using text-3-embedding-small):
|
| 46 |
+
|
| 47 |
+
| Task | Embedding | cohere-rerank-v3.5 | Salesforce/Llama-rank-v1 | **zerank-1-small** | zerank-1 |
|
| 48 |
+
|----------------|-----------|--------------------|--------------------------|----------------|----------|
|
| 49 |
+
| Code | 0.678 | 0.724 | 0.694 | **0.730** | 0.754 |
|
| 50 |
+
| Conversational | 0.250 | 0.571 | 0.484 | **0.556** | 0.596 |
|
| 51 |
+
| Finance | 0.839 | 0.824 | 0.828 | **0.861** | 0.894 |
|
| 52 |
+
| Legal | 0.703 | 0.804 | 0.767 | **0.817** | 0.821 |
|
| 53 |
+
| Medical | 0.619 | 0.750 | 0.719 | **0.773** | 0.796 |
|
| 54 |
+
| STEM | 0.401 | 0.510 | 0.595 | **0.680** | 0.694 |
|
| 55 |
+
|
| 56 |
+
Comparing BM25 and Hybrid Search without and with zerank-1:
|
| 57 |
+
|
| 58 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/67776f9dcd9c9435499eafc8/2GPVHFrI39FspnSNklhsM.png" alt="Description" width="400"/> <img src="https://cdn-uploads.huggingface.co/production/uploads/67776f9dcd9c9435499eafc8/dwYo2D7hoL8QiE8u3yqr9.png" alt="Description" width="400"/>
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
## Citation
|
| 62 |
+
|
| 63 |
+
**BibTeX:**
|
| 64 |
+
|
| 65 |
+
Coming soon!
|
| 66 |
+
|
| 67 |
+
**APA:**
|
| 68 |
+
|
| 69 |
+
Coming soon!
|
| 70 |
+
|