CoolFace
Apppublic

lbl/redaction

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes
README.md122 linesDownload Raw Back to root
1---2title: Redac3emoji: ๐Ÿ›ก๏ธ4colorFrom: blue5colorTo: gray6sdk: docker7pinned: false8license: mit9tags:10  - security11  - privacy12  - nlp13  - pii-redaction14  - privacy-protection15  - french-nlp16---17 18# ๐Ÿ›ก๏ธ Redac19 20A lightweight PII (Personally Identifiable Information) moderation MVP designed to sanitize sensitive data before it reaches LLM APIs.21 22---23 24## ๐ŸŽฅ Demo25 26Check out Redac in action:27 28<div align="center">29  <a href="https://www.youtube.com/shorts/OkwsoL4H5cc">30    <img src="https://img.youtube.com/vi/OkwsoL4H5cc/maxresdefault.jpg" alt="Redac Demo Video" width="600" style="border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);">31  </a>32  <p><i>Click to watch the full demo on YouTube</i></p>33</div>34 35---36 37## ๐Ÿ“– API Documentation38 39The Redac API is open and can be integrated into your own workflows.40 41### ๐Ÿ  Base URL42`https://lbl-redaction.hf.space/api`43 44### โšก Rate Limiting45- **1 request every 2 seconds** per IP address to ensure stability.46- Exceeding this limit will return a `429 Too Many Requests` status code with a helpful message.47 48### ๐Ÿ” Endpoints49 50#### 1. Redact Text51Processes a text and returns the anonymized version along with metadata about detected entities.52 53- **URL**: `/redact`54- **Method**: `POST`55- **Headers**: `Content-Type: application/json`56- **Body**:57  ```json58  {59    "text": "Your sensitive text here",60    "language": "auto" 61  }62  ```63  *(Options for language: `auto`, `en`, `fr`)*64 65- **Success Response (200 OK)**:66  ```json67  {68    "original_text": "...",69    "redacted_text": "My name is <PERSON>",70    "detected_language": "en",71    "entities": [72      {73        "type": "PERSON",74        "text": "John Doe",75        "score": 95,76        "start": 11,77        "end": 1978      }79    ]80  }81  ```82 83#### 2. System Status84Checks if the API and NLP engines are online.85 86- **URL**: `/status`87- **Method**: `GET`88 89---90 91## ๐Ÿš€ Key Features92 93- **Multi-Language Support**: High-accuracy detection for **English** and **French** using `spaCy` Large models.94- **Double-Pass Protection**: Combines NLP-based detection with expert Regex patterns for PII coverage.95- **Expert French Recognizers**: Built-in support for French-specific data: **SIRET**, **NIR**, **IBAN**, and addresses.96- **Balanced Anonymization**: Preserves job titles and document structure to keep texts readable.97- **Minimal Dashboard**: React-based UI with Risk Assessment visualization.98 99---100 101## ๐Ÿ› ๏ธ Architecture102 1031.  **Core API (`/api`)**: FastAPI server powered by **Microsoft Presidio**.1042.  **Web Dashboard (`/ui`)**: React + Vite + Tailwind CSS.105 106---107 108## ๐Ÿ“ฆ Local Development109 110### Manual Docker commands111```bash112docker compose up --build113```114 115- **API**: `http://localhost:8000/api`116- **UI Dashboard**: `http://localhost:5173`117 118---119 120## ๐Ÿ“„ License121MIT - Created for secure LLM workflows.122