File size: 946 Bytes
6f68924
20cbff3
 
 
 
6f68924
 
 
 
20cbff3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Bank Fraud Detection API
emoji: 🏦
colorFrom: red
colorTo: yellow
sdk: docker
pinned: false
---

# 🏦 Bank Fraud Detection API

A FastAPI-based fraud detection API powered by `austinb/fraud_text_detection` (DistilBERT).

## Endpoints

| Method | Endpoint | Description |
|--------|----------|-------------|
| GET | `/health` | Health check |
| POST | `/predict` | Single fraud risk score + risk level |
| POST | `/predict/batch` | Batch predictions |
| POST | `/analyze` | Full analysis — score + risk + binary detection |

## Example Usage

```bash
curl -X POST https://YOUR-SPACE-URL/analyze \
  -H "Content-Type: application/json" \
  -d '{"text": "User transferred 50000 to an unknown account at midnight"}'
```

## Response
```json
{
  "text": "User transferred 50000 to an unknown account at midnight",
  "fraud_score": 0.923,
  "risk_level": "High Risk 🚨",
  "is_fraud": true,
  "detection": "Fraud Detected 🚨"
}
```