Skip to main content

A lightweight tool for removing personal data from text before uploading to LLMs

Project description

AI Data Scrubber

The AI Data Scrubber is a lightweight privacy-focused tool designed to remove personal information from text documents before uploading them to Large Language Models (LLMs). You can use it to clean sensitive documents like resumes or contracts. It's not guaranteed to remove everything, so you should still check before you upload your file to a LLM.

It uses a mixture of regular expressions and named entity recognition models from spaCy. It's less accurate than asking a LLM to remove PII - but then you don't need to either run a LLM on your own machine, or upload your document to a LLM.

What It Does

The AI Data Scrubber removes personal information including:

  • Names
  • Email addresses
  • Phone numbers
  • Street addresses & ZIP codes
  • URLs
  • License plates

Currently, only US formats are supported.

You can run it via a command line interface or you can import it into your Python script.

Quick Start

# Install using pip
pip install ai-data-scrubber

# Download required language model (~560MB)
python -m spacy download en_core_web_lg

# Clean your file
ai-data-scrubber your-file.txt

Usage

Command Line:

# Auto-generates an output file with _scrubbed suffix
ai-data-scrubber input.txt

# Or you can specify the output file with the -o flag
ai-data-scrubber input.txt -o output.txt

Python:

from ai_data_scrubber import scrub_text, scrub_file

# Scrub text directly
cleaned = scrub_text("Your text with personal information here")

# Or scrub a file
scrub_file("input.txt", "output.txt")

Example

Original text:

John Smith
123 Main Street, Apt 4B
New York, NY 10001
Email: john.smith@example.com
Phone: (555) 123-4567

Cleaned text:

[NAME]
[ADDRESS], [UNIT]
New York, NY [ZIP_CODE]
Email: [EMAIL]
Phone: [PHONE]

Documentation

You can find further documentation in the docs folder:

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions welcome! Feel free to submit a Pull Request.

Project details


Download files

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

Source Distribution

ai_data_scrubber-0.1.1.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

ai_data_scrubber-0.1.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file ai_data_scrubber-0.1.1.tar.gz.

File metadata

  • Download URL: ai_data_scrubber-0.1.1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for ai_data_scrubber-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b219bbb2c814f1065ff79da9324a44d969a2ae8d4454aa1b29c2143a340b871b
MD5 16adbfd4f43d0b52f53c91de719cc1aa
BLAKE2b-256 676cd758a5b1f5685082c2a6ed44620b1706f0da21b1189294cc047ab3464b7a

See more details on using hashes here.

File details

Details for the file ai_data_scrubber-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_data_scrubber-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 26b4966b77ee131ae4b43011ad1994edd6ac1c0bc4753951bfdffa09da0025fa
MD5 d2445d80ebe028b55805d51bbec30221
BLAKE2b-256 eb13439332f5551bb749df8ff82abfed82d5eda5d87922067957bb544e5c84a7

See more details on using hashes here.

Supported by

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