Anonymizes personally identifiable information for Large Language Model APIs
Project description
anonLLM: Anonymize Personally Identifiable Information (PII) for Large Language Model APIs
anonLLM is a Python package designed to anonymize personally identifiable information (PII) in text data before it's sent to Language Model APIs like GPT-3. The goal is to protect user privacy by ensuring that sensitive data such as names, email addresses, and phone numbers are anonymized.
Features
Anonymize names Anonymize email addresses Anonymize phone numbers Support for multiple country-specific phone number formats Reversible anonymization (de-anonymization) Installation
To install anonLLM, run:
pip install anonLLM
Quick Start
Here's how to get started with anonLLM:
from anonLLM.llm import OpenaiLanguageModel
from dotenv import load_dotenv
load_dotenv()
# Anonymize a text
text = "Write a CV for me: My name is Alice Johnson, "\
"email: alice.johnson@example.com, phone: +1 234-567-8910."\
"I am a machine learning engineer."
# Anonymization is handled under the hood
llm = OpenaiLanguageModel()
response = llm.generate(text)
print(response)
In this example, the response will contain the correct name provided. At the same time, no PII will be sent to OpenAI.
Contributing
We welcome contributions!
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file anonLLM-0.1.9.tar.gz
.
File metadata
- Download URL: anonLLM-0.1.9.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a2c5e432d952b91d1e8f9ddafbcd5c581727c63f32d4799e769a51d8b60ba47 |
|
MD5 | 082eb8cb504e63803550489c344d210f |
|
BLAKE2b-256 | f99a62d85663d6f06a91c8e3e15f10ab3344d03b4c6d12cbf4d680ca80a185ee |
File details
Details for the file anonLLM-0.1.9-py3-none-any.whl
.
File metadata
- Download URL: anonLLM-0.1.9-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4018007857a168b0765488190ce2210fe22c6ad94e12e80e3e945aff742bf3d |
|
MD5 | 6012e1d136d4f89a822b102e687992c9 |
|
BLAKE2b-256 | 4d648d55c64e59f52ef411e0c90b19d32f2125266eb8f824a037d2c411df9dba |