Skip to main content
PIILO logo

PIILO

Personally Identifiable Information Labeling and Obfuscation

Tests License: Apache 2.0 Python 3.10+ Paper

What is PIILO?

PIILO is an open-source deidentification system for student-generated text. Most deidentification tools stop at finding personally identifiable information and replace it with a redaction marker such as <PERSON>. PIILO treats obfuscation as equally important: it replaces identifiers with realistic, contextually plausible surrogates, an approach known as HIPS (hiding in plain sight).

Redaction markers advertise exactly where sensitive content used to be and make the resulting text awkward to read or model. Surrogates keep the document natural, so deidentified text stays usable for downstream research.

Written by John Williams -- (714) 328-9989 -- johnwilliams@yahoo.com
                          |
                          v
Written by Stephen Yu    -- 272-947-1857   -- harveylisa@yahoo.com

Detection combines spaCy's named entity recognition with a rule- and feature-based recognizer adapted from the third-place solution to the Kaggle PII Detection Removal from Educational Data competition, which uses gradient-boosted trees over name lists and lexical features rather than a transformer.

Installation

pip install piilo-anonymizer

The package is distributed as piilo-anonymizer on PyPI, but you still import piilo and run the obfuscate command — the shorter name was already taken. The name tables and XGBoost models PIILO needs (roughly 120 MB) are bundled in the release, so pip install gives a fully working package with nothing else to download.

On macOS, XGBoost also needs the OpenMP runtime: brew install libomp.

Note Those model files are not stored in the git repository, only in the published package. If you install from a clone (pip install -e .) you must fetch them separately — see DEV_README.md.

Usage

As a Python package

import piilo

texts = [
    "test string without identifiers",
    "My name is Antonio. Email: Antonio99@yahoo.com",
]

# Locate PII. Returns presidio_analyzer.RecognizerResult objects.
results = [piilo.analyze(text) for text in texts]

# Locate and obfuscate PII with hiding-in-plain-sight surrogates.
cleaned = [piilo.anonymize(text).text for text in texts]

The models load on first use rather than at import, so the first call is slower than those that follow.

From the command line

obfuscate anonymizes every .txt file in a directory:

obfuscate --dir ./essays --file_format csv
Option Description
--dir Directory containing text files to anonymize. Defaults to the current directory, with a confirmation prompt.
--entities Restrict analysis to specific entity types. Defaults to all recognizers.
--language Language of the text files. Currently only en.
--file_format csv (one row per file) or txt (one output file per input).

With a graphical interface

A Streamlit app is included for interactive exploration:

pip install -e ".[app]"
streamlit run app.py

A packaged desktop build is also available from linguisticanalysistools.org.

Detected entities

Entity Obfuscation
PERSON Surrogate name matched on inferred gender and country of origin
EMAIL_ADDRESS Generated address
PHONE_NUMBER Generated number
URL Generated URL
STREET_ADDRESS Generated address
ID_NUM Generated identifier
DATE_TIME Date shifted while preserving format
LOCATION Preserved

Surrogates are consistent within a document: the same name is always replaced by the same surrogate, so coreference survives deidentification.

Development

See DEV_README.md for the package layout, how to obtain the model files, and how to build a release.

pip install -e ".[dev]"
pytest

Tests that need the model files skip automatically when those files are absent.

Citation

If you use PIILO in your research, please cite:

@article{holmes2023piilo,
  title={PIILO: an open-source system for personally identifiable information labeling and obfuscation},
  author={Holmes, Langdon and Crossley, Scott and Sikka, Harshvardhan and Morris, Wesley},
  journal={Information and Learning Sciences},
  volume={124},
  number={9/10},
  pages={266--284},
  year={2023},
  publisher={Emerald Publishing Limited},
  doi={10.1108/ILS-04-2023-0032}
}

License

Apache License 2.0. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

piilo_anonymizer-0.3.0.tar.gz (69.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

piilo_anonymizer-0.3.0-py3-none-any.whl (69.7 MB view details)

Uploaded Python 3

File details

Details for the file piilo_anonymizer-0.3.0.tar.gz.

File metadata

  • Download URL: piilo_anonymizer-0.3.0.tar.gz
  • Upload date:
  • Size: 69.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for piilo_anonymizer-0.3.0.tar.gz
Algorithm Hash digest
SHA256 38008c05816dd469aedf9adb732e0b2414605d2ed110d979e5d1f88b8b9e24a0
MD5 bf845991523bb901f74bd56eedaf68d6
BLAKE2b-256 a7e88372aaf614463a4767b1e724753d597e0656758e0702656a56edbdf4444e

See more details on using hashes here.

File details

Details for the file piilo_anonymizer-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for piilo_anonymizer-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1b2a9e4db098087126ca0e6f3f153406f0560e64b5b906f3751d7a8162ca2aa
MD5 0794ea354794ca595e3058a514e51c09
BLAKE2b-256 03beb157f6590d23fb0c6e208fe55087c71d956feb11f5524bd0a727c2dca5c5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page