Token Classification
Transformers
ONNX
Safetensors
Transformers.js
modernbert
pii
pii-detection
redaction
anonymization
privacy
secrets-detection
data-masking
ner
presidio
mmbert
Instructions to use Horizon-Labs/pii-redactor-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Horizon-Labs/pii-redactor-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="Horizon-Labs/pii-redactor-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("Horizon-Labs/pii-redactor-base") model = AutoModelForTokenClassification.from_pretrained("Horizon-Labs/pii-redactor-base", device_map="auto") - Transformers.js
How to use Horizon-Labs/pii-redactor-base with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('token-classification', 'Horizon-Labs/pii-redactor-base'); - Notebooks
- Google Colab
- Kaggle
Download eval/external_benchmarks.json from Horizon-Labs/pii-redactor-base: direct link, hf CLI and curl.
- Browser
- Download file 6.26 kB
-
https://huggingface.co/Horizon-Labs/pii-redactor-base/resolve/main/eval/external_benchmarks.json
- Command line
-
hf download hf://Horizon-Labs/pii-redactor-base/eval/external_benchmarks.json
-
curl -L -o external_benchmarks.json https://huggingface.co/Horizon-Labs/pii-redactor-base/resolve/main/eval/external_benchmarks.json
6.26 kB
| { | |
| "Horizon-Labs/pii-redactor-base": { | |
| "redactionbench": { | |
| "redact_recall": 0.19303528497535152, | |
| "redact_precision": 0.7381343302432494, | |
| "entity_recall": 0.21650091214029307, | |
| "redact_f1": 0.30603655544569275 | |
| }, | |
| "privacy_bench": { | |
| "redact_recall": 0.8067925302688282, | |
| "redact_precision": 0.9405502392344498, | |
| "entity_recall": 0.8032490974729242, | |
| "redact_f1": 0.8685518612614602 | |
| }, | |
| "tab_echr": { | |
| "redact_recall": 0.7424732520527494, | |
| "redact_precision": 0.8771166286149162, | |
| "entity_recall": 0.16164383561643836, | |
| "redact_f1": 0.8041982028299569 | |
| }, | |
| "ru_pii_benchmark": { | |
| "redact_recall": 0.711965811965812, | |
| "redact_precision": 0.9040055248618785, | |
| "entity_recall": 0.6634225466342255, | |
| "redact_f1": 0.7965748065721986 | |
| }, | |
| "ours_gretel": { | |
| "redact_recall": 0.9967031599900473, | |
| "redact_precision": 0.9921976592977894, | |
| "entity_recall": 0.9908864954432477, | |
| "redact_f1": 0.9944453064391 | |
| }, | |
| "ours_nemotron": { | |
| "redact_recall": 0.9858056127424423, | |
| "redact_precision": 0.9917774940044227, | |
| "entity_recall": 0.9782507015902713, | |
| "redact_f1": 0.9887825364664602 | |
| }, | |
| "ours_openpii": { | |
| "redact_recall": 0.9990570143623967, | |
| "redact_precision": 0.9977542741234425, | |
| "entity_recall": 0.9959278650378127, | |
| "redact_f1": 0.9984052192823486 | |
| }, | |
| "ours_synthetic_pii": { | |
| "redact_recall": 0.755673768344516, | |
| "redact_precision": 0.7275886031966643, | |
| "entity_recall": 0.6519795657726692, | |
| "redact_f1": 0.7413652933308856 | |
| }, | |
| "_meta": { | |
| "seconds": 139.15036749839783 | |
| } | |
| }, | |
| "openai/privacy-filter": { | |
| "redactionbench": { | |
| "redact_recall": 0.10411253308725321, | |
| "redact_precision": 0.8499767147894352, | |
| "entity_recall": 0.11375272170893898, | |
| "redact_f1": 0.18550304185661926 | |
| }, | |
| "privacy_bench": { | |
| "redact_recall": 0.7827826800738764, | |
| "redact_precision": 0.9655739779774712, | |
| "entity_recall": 0.7635379061371841, | |
| "redact_f1": 0.8646228820762736 | |
| }, | |
| "tab_echr": { | |
| "redact_recall": 0.3772082607613834, | |
| "redact_precision": 0.9726924627166466, | |
| "entity_recall": 0.29041095890410956, | |
| "redact_f1": 0.5436068382446859 | |
| }, | |
| "ru_pii_benchmark": { | |
| "redact_recall": 0.6651126651126651, | |
| "redact_precision": 0.7605508662816526, | |
| "entity_recall": 0.6634225466342255, | |
| "redact_f1": 0.7096373056994819 | |
| }, | |
| "ours_gretel": { | |
| "redact_recall": 0.8587335157999503, | |
| "redact_precision": 0.9189854879510052, | |
| "entity_recall": 0.8218724109362054, | |
| "redact_f1": 0.8878384462023282 | |
| }, | |
| "ours_nemotron": { | |
| "redact_recall": 0.6334535547884773, | |
| "redact_precision": 0.9616270326158474, | |
| "entity_recall": 0.6599625818521984, | |
| "redact_f1": 0.7637809236741664 | |
| }, | |
| "ours_openpii": { | |
| "redact_recall": 0.8621548430775182, | |
| "redact_precision": 0.9321604099132071, | |
| "entity_recall": 0.7838859802210587, | |
| "redact_f1": 0.8957919859314156 | |
| }, | |
| "ours_synthetic_pii": { | |
| "redact_recall": 0.7788099120532492, | |
| "redact_precision": 0.7197613518454469, | |
| "entity_recall": 0.7164750957854407, | |
| "redact_f1": 0.7481222797129174 | |
| }, | |
| "_meta": { | |
| "seconds": 1573.6283829212189 | |
| } | |
| }, | |
| "gravitee-io/bert-small-pii-detection": { | |
| "redactionbench": { | |
| "redact_recall": 0.06497850846305156, | |
| "redact_precision": 0.764184764895855, | |
| "entity_recall": 0.10098275760607309, | |
| "redact_f1": 0.1197727584145584 | |
| }, | |
| "privacy_bench": { | |
| "redact_recall": 0.8748204391545249, | |
| "redact_precision": 0.7559180778437805, | |
| "entity_recall": 0.8646209386281588, | |
| "redact_f1": 0.8110344827586207 | |
| }, | |
| "tab_echr": { | |
| "redact_recall": 0.5292361283901468, | |
| "redact_precision": 0.7097434419140963, | |
| "entity_recall": 0.4, | |
| "redact_f1": 0.6063407022226781 | |
| }, | |
| "ru_pii_benchmark": { | |
| "redact_recall": 0.6367521367521367, | |
| "redact_precision": 0.5364273090266414, | |
| "entity_recall": 0.5490673154906731, | |
| "redact_f1": 0.5823000675027534 | |
| }, | |
| "ours_gretel": { | |
| "redact_recall": 0.7795471510325952, | |
| "redact_precision": 0.9809784735812133, | |
| "entity_recall": 0.7050538525269263, | |
| "redact_f1": 0.8687393851166336 | |
| }, | |
| "ours_nemotron": { | |
| "redact_recall": 0.642059966255437, | |
| "redact_precision": 0.8755276933468423, | |
| "entity_recall": 0.6573900841908326, | |
| "redact_f1": 0.740835335196778 | |
| }, | |
| "ours_openpii": { | |
| "redact_recall": 0.7710237438947725, | |
| "redact_precision": 0.720535068691251, | |
| "entity_recall": 0.6672484002326934, | |
| "redact_f1": 0.7449248954610229 | |
| }, | |
| "ours_synthetic_pii": { | |
| "redact_recall": 0.45634740303135607, | |
| "redact_precision": 0.496091479716378, | |
| "entity_recall": 0.45742869306087697, | |
| "redact_f1": 0.47539020620709815 | |
| }, | |
| "_meta": { | |
| "seconds": 43.67218780517578 | |
| } | |
| }, | |
| "OpenMed/OpenMed-PII-SuperClinical-Small-44M-v1": { | |
| "redactionbench": { | |
| "redact_recall": 0.11456081983535298, | |
| "redact_precision": 0.755998034482022, | |
| "entity_recall": 0.12899429176719826, | |
| "redact_f1": 0.19897047556213074 | |
| }, | |
| "privacy_bench": { | |
| "redact_recall": 0.8639441822286066, | |
| "redact_precision": 0.8249240717154893, | |
| "entity_recall": 0.8709386281588448, | |
| "redact_f1": 0.8439833608981105 | |
| }, | |
| "tab_echr": { | |
| "redact_recall": 0.45483951231649666, | |
| "redact_precision": 0.7070624231145317, | |
| "entity_recall": 0.07123287671232877, | |
| "redact_f1": 0.5535749926906365 | |
| }, | |
| "ru_pii_benchmark": { | |
| "redact_recall": 0.7114219114219115, | |
| "redact_precision": 0.807763564181738, | |
| "entity_recall": 0.5652879156528792, | |
| "redact_f1": 0.7565379053914479 | |
| }, | |
| "ours_gretel": { | |
| "redact_recall": 0.9700796217964668, | |
| "redact_precision": 0.920819555975437, | |
| "entity_recall": 0.9449047224523612, | |
| "redact_f1": 0.9448079486247425 | |
| }, | |
| "ours_nemotron": { | |
| "redact_recall": 0.9449870749036422, | |
| "redact_precision": 0.878428156205934, | |
| "entity_recall": 0.9429373246024322, | |
| "redact_f1": 0.9104928374881619 | |
| }, | |
| "ours_openpii": { | |
| "redact_recall": 0.921127714106098, | |
| "redact_precision": 0.921194535122718, | |
| "entity_recall": 0.8266433973240256, | |
| "redact_f1": 0.921161123402609 | |
| }, | |
| "ours_synthetic_pii": { | |
| "redact_recall": 0.6458205244727204, | |
| "redact_precision": 0.6075110641721988, | |
| "entity_recall": 0.5278842060451255, | |
| "redact_f1": 0.6260803089003201 | |
| }, | |
| "_meta": { | |
| "seconds": 88.43544793128967 | |
| } | |
| } | |
| } |