Provides a mechanism to anonymize PII and PHI before sending to a LLM API
Project description
piigpt
Provides a mechanism to anonymize PII and PHI before sending to a LLM API
Basic Setup:
from Analyzers.AnalyzerType import AnalyzerType
from PIIScrubber import PIIScrubber
def main():
from dotenv import load_dotenv
load_dotenv("sample.env")
pii = PIIScrubber(AnalyzerType.AZURE)
text = "My phone number is 555-555-5555"
print(pii.scrub([text]))
print(pii.get_entities([text]))
print(pii.anonymize(pii.get_entities([text]), text))
print(pii.deanonymize(pii.anonymize(pii.get_entities([text]), text)))
if __name__ == "__main__":
main()
Output: ['My phone number is ************'] [Text: 555-555-5555, Category: PhoneNumber, Subcategory: None, Offset: 19, Length: 12] My phone number is :yudDNDuGJG: My phone number is 555-555-5555
Extensible
Analyzers:
Currently AzureAIAnalyzer is supported. Contribute by adding additional analyzers following the BaseAnalyzer interface. Configure your parameters for your analyzer in the analyzer_config.toml file
Anonymizers:
Plug in your own anonymizer or use the built in Anonymizer. Change how the built in anonymizer anonymizes entities by changing the anonymizer_config.toml file or use the defaults.
CacheProviders:
Use the built in dictionary cache provider or insert your own CacheProvider following the BaseCache interface. Cache ensures all PII is deleted in a timely manner
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file piigpt-0.13.tar.gz.
File metadata
- Download URL: piigpt-0.13.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
112ba3359dcb1f863efc8882f3cb346d2c6bae663c3c3695aac6795e18a5a74a
|
|
| MD5 |
aa0982dc206c655d6b3518eae38d213b
|
|
| BLAKE2b-256 |
edf921b55a4680152576f59d3a5daafa200ab92223cbad8c67cac0816ec9995b
|
File details
Details for the file piigpt-0.13-py3-none-any.whl.
File metadata
- Download URL: piigpt-0.13-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2384aea168b779c9b64af748c586869b23c0ee95a517e1487bed525fd211cc6
|
|
| MD5 |
eb2cf2eb99a9b668129ad80e7e574b30
|
|
| BLAKE2b-256 |
bb03c2661b4237265313cddbf34d010135836da993c9e37a36e8386541a220df
|