File size: 1,166 Bytes
c949641
dc6630c
 
 
 
c949641
dc6630c
c949641
dc6630c
c949641
 
dc6630c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Privacy Sanitizer API
emoji: 🔒
colorFrom: purple
colorTo: blue
sdk: docker
app_port: 7860
pinned: false
private: true
---

# Privacy Sanitizer — Backend API

FastAPI backend for the Privacy Text Sanitizer app.  
NER-based PII detection using HuggingFace Transformers.

## Endpoints

| Method | Path            | Description               |
| ------ | --------------- | ------------------------- |
| `GET`  | `/health`       | Health check              |
| `GET`  | `/api/models`   | List available NER models |
| `POST` | `/api/sanitize` | Sanitize text             |

## Environment variables (set in Space Secrets)

| Variable             | Description                                                       |
| -------------------- | ----------------------------------------------------------------- |
| `FRONTEND_URL`       | Vercel frontend URL for CORS (e.g. `https://your-app.vercel.app`) |
| `DEFAULT_MODEL_NAME` | Override default NER model                                        |

## Deploy

This Space is deployed from `deploy/hf-space/` in the main repo.  
Push only the backend `app/` and `requirements.txt` alongside this `Dockerfile`.