Instructions to use desert-ant-labs/redact with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use desert-ant-labs/redact with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Model card: unified repo + LiteRT/.tflite (drop ONNX; point to Desert-Ant-Labs/redact)
Browse files
README.md
CHANGED
|
@@ -32,7 +32,9 @@ tags:
|
|
| 32 |
- redaction
|
| 33 |
- token-classification
|
| 34 |
- on-device
|
| 35 |
-
-
|
|
|
|
|
|
|
| 36 |
- multilingual
|
| 37 |
pipeline_tag: token-classification
|
| 38 |
---
|
|
@@ -43,18 +45,20 @@ Detects and redacts personal data (names, addresses, emails, phone numbers,
|
|
| 43 |
cards, IBANs, national IDs and more) in text across **all 24 official EU
|
| 44 |
languages** (Latin, Greek and Cyrillic scripts). A BIOES token classifier plus a
|
| 45 |
portable, dependency-free deterministic layer for structured IDs. The deployable
|
| 46 |
-
model is **~
|
| 47 |
-
|
| 48 |
|
| 49 |
> `"Call Anna Kovács at anna@example.hu, IBAN GB29NWBK60161331926819"` →
|
| 50 |
> `"Call [GIVEN_NAME] [SURNAME] at [EMAIL], IBAN [BANK_ACCOUNT]"`
|
| 51 |
|
| 52 |
## Try it
|
| 53 |
|
|
|
|
|
|
|
| 54 |
- **Live demo:** [desert-ant-labs/redact-demo](https://huggingface.co/spaces/desert-ant-labs/redact-demo): paste text and watch PII get highlighted or masked, fully in your browser.
|
| 55 |
-
- **iOS / macOS / tvOS / visionOS:**
|
| 56 |
-
- **
|
| 57 |
-
- **
|
| 58 |
|
| 59 |
```swift
|
| 60 |
import Redact
|
|
@@ -68,14 +72,18 @@ r.redactedText // "Email [GIVEN_NAME_1] [SURNAME_1] at [EMAIL_1]."
|
|
| 68 |
|
| 69 |
| File | Format | Size | Contents |
|
| 70 |
|---|---|---:|---|
|
| 71 |
-
| `redact.
|
| 72 |
-
| `redact.mlmodelc` | Compiled Core ML (4-bit) | ~11.6 MB | Palettized model, ready to load on Apple platforms (used by
|
| 73 |
| `redact.pt` | PyTorch checkpoint | ~90 MB | Full-precision weights + config (for retraining / other runtimes) |
|
| 74 |
| `config.json` | JSON | tiny | Transformer + label config |
|
| 75 |
| `tokenizer.json`, `tokenizer_config.json` | JSON | ~2.3 MB | EU-trimmed (31,475-piece) SentencePiece tokenizer (XLM-R lineage) |
|
|
|
|
| 76 |
| `labels.json` | JSON | tiny | BIOES `id2label` / `label2id` |
|
| 77 |
| `redact_meta.json` | JSON | tiny | Public labels, deterministic-owner labels, recommended thresholds, base-model info |
|
| 78 |
|
|
|
|
|
|
|
|
|
|
| 79 |
## Taxonomy (20 public labels)
|
| 80 |
|
| 81 |
`GIVEN_NAME`, `SURNAME`, `STREET_NAME`, `BUILDING_NUMBER`, `SECONDARY_ADDRESS`,
|
|
|
|
| 32 |
- redaction
|
| 33 |
- token-classification
|
| 34 |
- on-device
|
| 35 |
+
- litert
|
| 36 |
+
- tflite
|
| 37 |
+
- core-ml
|
| 38 |
- multilingual
|
| 39 |
pipeline_tag: token-classification
|
| 40 |
---
|
|
|
|
| 45 |
cards, IBANs, national IDs and more) in text across **all 24 official EU
|
| 46 |
languages** (Latin, Greek and Cyrillic scripts). A BIOES token classifier plus a
|
| 47 |
portable, dependency-free deterministic layer for structured IDs. The deployable
|
| 48 |
+
model is **~11.6 MB** (4-bit Core ML on Apple) or **~24 MB** (int8 LiteRT
|
| 49 |
+
`.tflite` on Android, Linux and the web).
|
| 50 |
|
| 51 |
> `"Call Anna Kovács at anna@example.hu, IBAN GB29NWBK60161331926819"` →
|
| 52 |
> `"Call [GIVEN_NAME] [SURNAME] at [EMAIL], IBAN [BANK_ACCOUNT]"`
|
| 53 |
|
| 54 |
## Try it
|
| 55 |
|
| 56 |
+
All platforms ship from one repo: **[Desert-Ant-Labs/redact](https://github.com/Desert-Ant-Labs/redact)** (Swift, Kotlin, and JavaScript in a single codebase).
|
| 57 |
+
|
| 58 |
- **Live demo:** [desert-ant-labs/redact-demo](https://huggingface.co/spaces/desert-ant-labs/redact-demo): paste text and watch PII get highlighted or masked, fully in your browser.
|
| 59 |
+
- **iOS / macOS / tvOS / visionOS:** the Swift SDK (Swift Package Manager) with a built-in demo app. It bundles the compiled Core ML model below.
|
| 60 |
+
- **Android / JVM (Kotlin):** Maven Central `ai.desertant:redact` — LiteRT (`.tflite`), with the model downloaded on demand or bundled via `ai.desertant:redact-tflite-resources`.
|
| 61 |
+
- **Node / browser (JavaScript / TypeScript):** `npm i @desert-ant-labs/redact @litertjs/core` — a local WebAssembly pipeline with [LiteRT.js](https://www.npmjs.com/package/@litertjs/core) inference; fetches the model from this repo and caches it.
|
| 62 |
|
| 63 |
```swift
|
| 64 |
import Redact
|
|
|
|
| 72 |
|
| 73 |
| File | Format | Size | Contents |
|
| 74 |
|---|---|---:|---|
|
| 75 |
+
| `redact.tflite` | LiteRT / TFLite (int8) | ~24 MB | Dynamic-range int8, fixed `[1, 256]` window; runs on Android, Linux and the web (used by the Kotlin and JavaScript SDKs) |
|
| 76 |
+
| `redact.mlmodelc` | Compiled Core ML (4-bit) | ~11.6 MB | Palettized model, ready to load on Apple platforms (used by the Swift SDK) |
|
| 77 |
| `redact.pt` | PyTorch checkpoint | ~90 MB | Full-precision weights + config (for retraining / other runtimes) |
|
| 78 |
| `config.json` | JSON | tiny | Transformer + label config |
|
| 79 |
| `tokenizer.json`, `tokenizer_config.json` | JSON | ~2.3 MB | EU-trimmed (31,475-piece) SentencePiece tokenizer (XLM-R lineage) |
|
| 80 |
+
| `redact_tokenizer.bin` | Binary | ~0.4 MB | Compact SentencePiece vocab bundled by the SDKs |
|
| 81 |
| `labels.json` | JSON | tiny | BIOES `id2label` / `label2id` |
|
| 82 |
| `redact_meta.json` | JSON | tiny | Public labels, deterministic-owner labels, recommended thresholds, base-model info |
|
| 83 |
|
| 84 |
+
Older revisions (tags `v0.2.x`) additionally carry `redact.onnx` for SDK
|
| 85 |
+
versions that predate the LiteRT migration.
|
| 86 |
+
|
| 87 |
## Taxonomy (20 public labels)
|
| 88 |
|
| 89 |
`GIVEN_NAME`, `SURNAME`, `STREET_NAME`, `BUILDING_NUMBER`, `SECONDARY_ADDRESS`,
|