test / README.md
Ramosh99's picture
revert: Gradio 5.x + ZeroGPU @spaces.GPU + demo.launch (was working, 4.x had Starlette bug)
1cca871
|
Raw History Blame Contribute Delete
1.1 kB
---
title: Sinhala English Codemix PII Detector
emoji: ๐Ÿ”’
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: "5.0.0"
python_version: "3.10"
app_file: app.py
pinned: false
---
# ๐Ÿ”’ Sinhala-English Codemix PII Detector
Detects PII entities (PERSON, ORG, PHONE, EMAIL, NIC, etc.) in Sinhala-English code-mixed text using the [`Ramosh99/mixcode_pii_detector`](https://huggingface.co/Ramosh99/mixcode_pii_detector) model.
## REST API
This Space also exposes a FastAPI endpoint alongside the Gradio UI.
### `POST /api/detect`
**Request:**
```json
{
"text": "Mage name Kamal, phone 071-1234567"
}
```
**Response:**
```json
{
"text": "Mage name Kamal, phone 071-1234567",
"entities": [
{ "entity": "PERSON", "start": 10, "end": 15, "score": 0.9821 },
{ "entity": "PHONE", "start": 23, "end": 34, "score": 0.9934 }
],
"redacted_text": "Mage name [PERSON], phone [PHONE]"
}
```
### `GET /api/health`
Returns model status.
### `GET /docs`
Interactive Swagger UI for the API.
## Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference