Views
No views yet
| Category | What it detects | Examples |
|---|---|---|
company_name | Supplier names, customer account names, corporate entities | Meridian Logistics Ltd, Apex Manufacturing PLC, TechStart Solutions Inc |
price | Monetary values with currency symbols or codes | GBP 4,250.00, $12,500, EUR 5,000, 2,500 GBP |
id_number | Purchase orders, invoice numbers, case IDs, internal references | PO-00442, INV/2024/00567, CASE-20240315-001, ORD-78542 |
model.safetensors and config.json - the finetuned OPF checkpoint.clean_excel.py - a helper script for cleaning Excel workbooks.requirements.txt - Python packages needed by the helper script.dummy_procurement_data.xlsx - a sample workbook for testing the setup.label_space.json - the full label list used by the model.clean_excel.py takes an input .xlsx file and creates a new cleaned workbook.<column>_clean columns containing the synthetic text.PII_Audit_Log sheet showing what was detected and replaced.Meridian Logistics Ltd appears ten times in one workbook, it will be replaced with the same synthetic company each time in that run.1mkdir privacy-filter-demo
2cd privacy-filter-demo
3
4py -3.12 -m venv .venv
5.\.venv\Scripts\Activate.ps1
6
7python -m pip install -U pip huggingface_hub
8
9hf download galexdav/privacy-filter-finetuned `
10 --include clean_excel.py `
11 --include requirements.txt `
12 --include dummy_procurement_data.xlsx `
13 --include label_space.json `
14 --local-dir .
15
16python -m pip install -r requirements.txtpy -3.12 does not work, use your installed Python launcher instead, for example:python -m venv .venv1mkdir privacy-filter-demo
2cd privacy-filter-demo
3
4python3 -m venv .venv
5source .venv/bin/activate
6
7python -m pip install -U pip huggingface_hub
8
9hf download galexdav/privacy-filter-finetuned \
10 --include clean_excel.py \
11 --include requirements.txt \
12 --include dummy_procurement_data.xlsx \
13 --include label_space.json \
14 --local-dir .
15
16python -m pip install -r requirements.txtpython clean_excel.py dummy_procurement_data.xlsx --device cpudummy_procurement_data_cleaned.xlsxmodels/privacy-filter-finetunedclean_excel.py, then run:python clean_excel.py your_data.xlsx --device cpupython clean_excel.py your_data.xlsx --columns Supplier Notes ContactEmail InvoiceRef Amount --device cpupython clean_excel.py your_data.xlsx --all-sheets --device cpupython clean_excel.py your_data.xlsx --all-sheets --device cpu --output your_data_sanitised.xlsxpython clean_excel.py your_data.xlsx --all-sheets --device cuda1cd privacy-filter-demo
2.\.venv\Scripts\Activate.ps1
3python clean_excel.py another_file.xlsx --all-sheets --device cpu1cd privacy-filter-demo
2source .venv/bin/activate
3python clean_excel.py another_file.xlsx --all-sheets --device cpuPII_Audit_Log sheet contains original detected values, so treat the cleaned workbook as sensitive if you keep that audit sheet.replacement_map.json.1from huggingface_hub import snapshot_download
2from opf import OPF
3
4checkpoint = snapshot_download("galexdav/privacy-filter-finetuned")
5model = OPF(model=checkpoint, device="cpu")
6
7result = model.redact("PO-00442 raised for Meridian Logistics Ltd, total GBP 4,250.00.")
8for span in result.detected_spans:
9 print(f"{span.label}: {span.text}")1{
2 "category_version": "custom_v1_extended",
3 "span_class_names": [
4 "O",
5 "private_person",
6 "private_email",
7 "private_phone",
8 "private_address",
9 "account_number",
10 "private_url",
11 "private_date",
12 "secret",
13 "company_name",
14 "price",
15 "id_number"
16 ]
17}| Field | Value |
|---|---|
| Base model | openai/privacy-filter |
| Training examples | about 830 |
| Validation examples | about 130 |
| Epochs | 3 |
| Hardware | 1x NVIDIA L4, 24 GB, via Hugging Face Jobs |
| Training time | about 41 minutes |
id_number rather than secret.