Upgrade Cross-Encoder to BAAI/bge-reranker-base (README.md)
Browse files
README.md
CHANGED
|
@@ -1,13 +1,53 @@
|
|
| 1 |
---
|
| 2 |
-
title: Cross
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk:
|
| 7 |
-
sdk_version: 6.2.0
|
| 8 |
-
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
-
|
| 11 |
---
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Cross-Encoder Reranking API
|
| 3 |
+
emoji: ⚖️
|
| 4 |
+
colorFrom: indigo
|
| 5 |
+
colorTo: blue
|
| 6 |
+
sdk: docker
|
|
|
|
|
|
|
| 7 |
pinned: false
|
| 8 |
+
app_port: 7860
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# ⚖️ FinReg BGE Cross-Encoder Reranking API
|
| 12 |
+
|
| 13 |
+
High-performance cloud cross-encoder re-ranking service powered by **`BAAI/bge-reranker-base`**.
|
| 14 |
+
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
## 🚀 Quick Usage (POST `/rerank`)
|
| 18 |
+
|
| 19 |
+
### Request
|
| 20 |
+
```json
|
| 21 |
+
POST /rerank
|
| 22 |
+
Content-Type: application/json
|
| 23 |
+
|
| 24 |
+
{
|
| 25 |
+
"query": "What are Priority Sector Lending targets under RBI norms?",
|
| 26 |
+
"documents": [
|
| 27 |
+
"RBI Circular on Priority Sector Lending: Domestic commercial banks must achieve 40% of ANBC...",
|
| 28 |
+
"SEBI Mutual Fund regulations: AMCs must maintain minimum net worth of Rs 50 Crore...",
|
| 29 |
+
"PMLA Act: Banking entities must retain transaction records for 5 years..."
|
| 30 |
+
],
|
| 31 |
+
"top_k": 2
|
| 32 |
+
}
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
### Response
|
| 36 |
+
```json
|
| 37 |
+
{
|
| 38 |
+
"query": "What are Priority Sector Lending targets under RBI norms?",
|
| 39 |
+
"model": "BAAI/bge-reranker-base",
|
| 40 |
+
"total_evaluated": 3,
|
| 41 |
+
"latency_ms": 42.5,
|
| 42 |
+
"scores": [0.954, 0.001, 0.002],
|
| 43 |
+
"ranked_indices": [0, 2, 1],
|
| 44 |
+
"ranked_results": [
|
| 45 |
+
{
|
| 46 |
+
"rank": 1,
|
| 47 |
+
"original_index": 0,
|
| 48 |
+
"score": 0.954,
|
| 49 |
+
"document": "RBI Circular on Priority Sector Lending: Domestic commercial banks must achieve 40% of ANBC..."
|
| 50 |
+
}
|
| 51 |
+
]
|
| 52 |
+
}
|
| 53 |
+
```
|