File size: 1,245 Bytes
a577335
162fc94
 
 
 
 
a577335
162fc94
a577335
 
162fc94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
title: Cross-Encoder Reranking API
emoji: ⚖️
colorFrom: indigo
colorTo: blue
sdk: docker
pinned: false
app_port: 7860
---

# ⚖️ FinReg BGE Cross-Encoder Reranking API

High-performance cloud cross-encoder re-ranking service powered by **`BAAI/bge-reranker-base`**.

---

## 🚀 Quick Usage (POST `/rerank`)

### Request
```json
POST /rerank
Content-Type: application/json

{
  "query": "What are Priority Sector Lending targets under RBI norms?",
  "documents": [
    "RBI Circular on Priority Sector Lending: Domestic commercial banks must achieve 40% of ANBC...",
    "SEBI Mutual Fund regulations: AMCs must maintain minimum net worth of Rs 50 Crore...",
    "PMLA Act: Banking entities must retain transaction records for 5 years..."
  ],
  "top_k": 2
}
```

### Response
```json
{
  "query": "What are Priority Sector Lending targets under RBI norms?",
  "model": "BAAI/bge-reranker-base",
  "total_evaluated": 3,
  "latency_ms": 42.5,
  "scores": [0.954, 0.001, 0.002],
  "ranked_indices": [0, 2, 1],
  "ranked_results": [
    {
      "rank": 1,
      "original_index": 0,
      "score": 0.954,
      "document": "RBI Circular on Priority Sector Lending: Domestic commercial banks must achieve 40% of ANBC..."
    }
  ]
}
```