Metadata-Version: 2.5
Name: decima-pii
Version: 2.5.0
Summary: Find and redact personal data in Arabic, Persian, Urdu, Turkish and English on CPU. Alias for decima-ai (decima.pii).
Project-URL: Homepage, https://github.com/amyrmahdy/decima
Project-URL: Model, https://huggingface.co/amyrmahdy/decima-pii
Project-URL: Demo, https://amyrmahdy-decima-playground.static.hf.space/pii.html
Project-URL: Issues, https://github.com/amyrmahdy/decima/issues
Author-email: "A. M. Madani" <amyrmahdy1@gmail.com>
License-Expression: Apache-2.0
Keywords: arabic,onnx,persian,pii,pii-detection,privacy,redaction,turkish,urdu
Requires-Python: >=3.11
Requires-Dist: decima-ai>=2.5.0
Description-Content-Type: text/markdown

# decima-pii

Find and redact personal data (names, phones, emails, national IDs, IBANs, cards, passports, addresses, dates of
birth, IP addresses) in Arabic, Persian, Urdu, Turkish and English, including numbers in Persian and Arabic-Indic
digits. CPU, int8 ONNX, no PyTorch.

This package is a small alias. The code lives in [decima-ai](https://pypi.org/project/decima-ai/) (`decima.pii`), and
installing `decima-pii` installs it, plus a `decima-pii` command. You can use either:

```bash
pip install decima-pii        # or: pip install decima-ai
```

```python
from decima import PII        # or: from decima_pii import PII

pii = PII.from_pretrained()   # amyrmahdy/decima-pii v0.2, 148 MB, downloaded once
pii.redact("اسمي محمود الشمري ورقم جوالي ٠٥٥١٢٣٤٥٦٧")   # 'اسمي [PERSON_NAME] ورقم جوالي [PHONE]'
pii.find("...")               # [{"start", "end", "label", "text"}, ...]
```

```bash
decima-pii "سلام، من سارا احمدی هستم. کد ملی من ۰۰۱۲۳۴۵۶۷۸ است."   # same as: decima pii "..."
cat letter.txt | decima-pii --redact-only
```

2.5.0 loads model tag v0.2 by default, so a later model update will not change your results until you upgrade.
`PII.from_pretrained(revision="v0.1")` (or `decima-pii --revision v0.1 "..."`) gives the previous model and its exact
output.

- Model, results and limits: https://huggingface.co/amyrmahdy/decima-pii (a preview; please read the limits)
- Try it in the browser: https://amyrmahdy-decima-playground.static.hf.space/pii.html
- Code, LiteLLM guardrail and Presidio recognizer: https://github.com/amyrmahdy/decima

Apache-2.0.
