Instructions to use joneauxedgar/pasteproof-pii-detector-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use joneauxedgar/pasteproof-pii-detector-onnx with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('token-classification', 'joneauxedgar/pasteproof-pii-detector-onnx');
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language: [en]
|
| 4 |
+
library_name: onnx
|
| 5 |
+
pipeline_tag: token-classification
|
| 6 |
+
tags:
|
| 7 |
+
- onnx
|
| 8 |
+
- quantized
|
| 9 |
+
- pii
|
| 10 |
+
- privacy
|
| 11 |
+
- browser
|
| 12 |
+
- transformers.js
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# PasteProof PII Detector - ONNX (Browser-Ready)
|
| 16 |
+
|
| 17 |
+
Quantized ONNX version of [pasteproof-pii-detector-v3](https://huggingface.co/joneauxedgar/pasteproof-pii-detector-v3) for fast browser-side inference.
|
| 18 |
+
|
| 19 |
+
## Performance
|
| 20 |
+
|
| 21 |
+
| Metric | Value |
|
| 22 |
+
|--------|-------|
|
| 23 |
+
| Model size | ~147 MB |
|
| 24 |
+
| Inference time | 50-100ms (browser) |
|
| 25 |
+
| Accuracy | ~97% F1 (minimal loss from quantization) |
|
| 26 |
+
|
| 27 |
+
## Usage with Transformers.js
|
| 28 |
+
|
| 29 |
+
```javascript
|
| 30 |
+
import { pipeline } from '@xenova/transformers';
|
| 31 |
+
|
| 32 |
+
const detector = await pipeline(
|
| 33 |
+
'token-classification',
|
| 34 |
+
'joneauxedgar/pasteproof-pii-detector-onnx'
|
| 35 |
+
);
|
| 36 |
+
|
| 37 |
+
const results = await detector('const key = "sk_live_abc123";');
|
| 38 |
+
console.log(results);
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## Usage with ONNX Runtime Web
|
| 42 |
+
|
| 43 |
+
```javascript
|
| 44 |
+
import * as ort from 'onnxruntime-web';
|
| 45 |
+
|
| 46 |
+
const session = await ort.InferenceSession.create('model.onnx');
|
| 47 |
+
// ... tokenize and run inference
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
## Files
|
| 51 |
+
|
| 52 |
+
- `model.onnx` - Quantized ONNX model
|
| 53 |
+
- `tokenizer.json` - Tokenizer vocabulary
|
| 54 |
+
- `tokenizer_config.json` - Tokenizer settings
|
| 55 |
+
- `config.json` - Model configuration
|
| 56 |
+
- `special_tokens_map.json` - Special token mappings
|
| 57 |
+
|
| 58 |
+
## Original Model
|
| 59 |
+
|
| 60 |
+
See [pasteproof-pii-detector-v3](https://huggingface.co/joneauxedgar/pasteproof-pii-detector-v3) for full details on entity types and training.
|