Views
No views yet
distilbert-base-uncased) for Named Entity Recognition (NER), specifically designed to detect Personally Identifiable Information (PII) in English text.O for non-entity tokens):| Entity | Description |
|---|---|
AMOUNT | Monetary values, amounts, percentages |
COUNTRY | Country names |
CREDENTIALS | Passwords, access keys, or secret tokens |
DATE | Calendar dates |
EMAIL | Email addresses |
EXPIRYDATE | Expiry dates (e.g., card expiry) |
FIRSTNAME | First names |
IPADDRESS | IPv4 or IPv6 addresses |
LASTNAME | Last names |
LOCATION | General locations (cities, regions, etc.) |
MACADDRESS | MAC addresses |
NUMBER | Generic numeric identifiers |
ORGANIZATION | Company or institution names |
PERCENT | Percentages |
PHONE | Phone numbers |
TIME | Time expressions (HH:MM, AM/PM, etc.) |
UID | Unique IDs (customer IDs, transaction IDs, etc.) |
ZIPCODE | Postal/ZIP codes |
training_dataset.json)1from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
2
3tokenizer = AutoTokenizer.from_pretrained("narayan214/distilbert_base_pii_redact")
4model = AutoModelForTokenClassification.from_pretrained("narayan214/distilbert_base_pii_redact")
5
6pii_pipeline = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="simple")
7
8text = "John Doe's email is john.doe@example.com and his phone number is +1-202-555-0173."
9print(pii_pipeline(text))1@article{sanh2019distilbert,
2 title={DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter},
3 author={Sanh, Victor and Debut, Lysandre and Chaumond, Julien and Wolf, Thomas},
4 journal={arXiv preprint arXiv:1910.01108},
5 year={2019}
6}