Text Classification
Transformers
Safetensors
English
roberta
data-classification
sensitivity
data-governance
Synthetic
text-embeddings-inference
Instructions to use aitrainingdatabroker/document-sensitivity-tier-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aitrainingdatabroker/document-sensitivity-tier-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="aitrainingdatabroker/document-sensitivity-tier-classifier")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("aitrainingdatabroker/document-sensitivity-tier-classifier") model = AutoModelForSequenceClassification.from_pretrained("aitrainingdatabroker/document-sensitivity-tier-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: text-classification
|
| 7 |
+
base_model: distilroberta-base
|
| 8 |
+
datasets:
|
| 9 |
+
- aitrainingdatabroker/synthetic-document-sensitivity-tiers
|
| 10 |
+
tags:
|
| 11 |
+
- data-classification
|
| 12 |
+
- sensitivity
|
| 13 |
+
- data-governance
|
| 14 |
+
- text-classification
|
| 15 |
+
- synthetic
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# Document Sensitivity Tier Classifier
|
| 19 |
+
|
| 20 |
+
Reads a short description of a document and suggests a sensitivity tier: `public`, `internal`, `confidential` or `restricted`.
|
| 21 |
+
|
| 22 |
+
Every name, number and sentence it was trained on is made up. Nothing comes from a real person, customer or business.
|
| 23 |
+
|
| 24 |
+
Related tool: [document-sensitivity-keyword-sorter](https://huggingface.co/spaces/aitrainingdatabroker/document-sensitivity-keyword-sorter) (a Space that runs in your browser).
|
| 25 |
+
|
| 26 |
+
## Why it exists
|
| 27 |
+
|
| 28 |
+
Before data leaves a company, someone sorts what it holds by how sensitive it is. This model gives that sort a first draft.
|
| 29 |
+
|
| 30 |
+
## Use it
|
| 31 |
+
|
| 32 |
+
```python
|
| 33 |
+
from transformers import pipeline
|
| 34 |
+
|
| 35 |
+
classify = pipeline("text-classification", model="aitrainingdatabroker/document-sensitivity-tier-classifier", top_k=3)
|
| 36 |
+
print(classify("Customer database export with emails, phone numbers and home addresses."))
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
## How it was trained
|
| 40 |
+
|
| 41 |
+
Fine-tuned from `distilroberta-base` for 6 epochs on one RTX 3070. Training data: 305 rows from [synthetic-document-sensitivity-tiers](https://huggingface.co/datasets/aitrainingdatabroker/synthetic-document-sensitivity-tiers), all invented, with test rows built from templates the model never saw in training. The scripts that built the data and trained the model are in `source/`; the full scores are in `scores.json`.
|
| 42 |
+
|
| 43 |
+
## Test scores
|
| 44 |
+
|
| 45 |
+
On 77 held-out rows: accuracy 0.831, macro F1 0.823.
|
| 46 |
+
|
| 47 |
+
| Label | F1 | Count |
|
| 48 |
+
|---|---|---|
|
| 49 |
+
| `confidential` | 0.857 | 19 |
|
| 50 |
+
| `internal` | 0.816 | 20 |
|
| 51 |
+
| `public` | 0.974 | 20 |
|
| 52 |
+
| `restricted` | 0.645 | 18 |
|
| 53 |
+
|
| 54 |
+
## Limits
|
| 55 |
+
|
| 56 |
+
- Trained only on invented text from templates, with test sentences built from templates it never saw. Real text varies far more.
|
| 57 |
+
- Tiers differ between companies and laws. A model's tier is a suggestion; the owner of the data sets the tier.
|
| 58 |
+
- This model is not legal advice and not a certification. A person should review its output before anything is shared or decided, and your counsel decides what a rule requires.
|
| 59 |
+
|
| 60 |
+
## Read more
|
| 61 |
+
|
| 62 |
+
- [De-identification before data is licensed](https://aitrainingdatabroker.com/de-identification/?utm_source=huggingface&utm_medium=model&utm_campaign=document-sensitivity-tier-classifier)
|
| 63 |
+
- [Privacy rules by region](https://aitrainingdatabroker.com/regions/?utm_source=huggingface&utm_medium=model&utm_campaign=document-sensitivity-tier-classifier)
|
| 64 |
+
- [Can you license SOPs and knowledge bases?](https://aitrainingdatabroker.com/data/sops-and-knowledge-bases/?utm_source=huggingface&utm_medium=model&utm_campaign=document-sensitivity-tier-classifier)
|
| 65 |
+
|
| 66 |
+
## License and credit
|
| 67 |
+
|
| 68 |
+
Apache 2.0. Please credit **AI Training Data Broker** and link to https://aitrainingdatabroker.com/ when you share or build on it.
|
| 69 |
+
|
| 70 |
+
## About
|
| 71 |
+
|
| 72 |
+
AI Training Data Broker is a broker and technical advisor for companies that sell or license their data to AI labs. It guides the technical side, including export, format, de-identification and compliance, and publishes free guides, checklists and tools.
|