flohannes commited on
Commit
bfecde9
·
verified ·
1 Parent(s): e4cbdb8

Smith-Pincette-Sprint v0.55

Browse files
Files changed (4) hide show
  1. README.md +20 -18
  2. calibrated_thresholds.json +43 -43
  3. config.json +3 -84
  4. model.onnx +2 -2
README.md CHANGED
@@ -2,7 +2,7 @@
2
  license: apache-2.0
3
  library_name: smith-pincette
4
  pipeline_tag: token-classification
5
- base_model: jhu-clsp/mmBERT-base
6
  tags:
7
  - pii-detection
8
  - span-extraction
@@ -11,19 +11,19 @@ tags:
11
  - onnx
12
  ---
13
 
14
- # Smith-Pincette-Sprint v0.5-preview
15
 
16
  Part of the **Smith-Pincette Model Family**: compact models that extract exact spans of personal data (names, contact details, addresses,
17
- ID and bank numbers, and more) from text, so it can be masked before it reaches logs, LLMs or third parties. Smith-Pincette-Sprint is the larger tier: same heads and classes on a wider multilingual encoder.
18
  **This is a preview release**: expect rough edges, and expect the models and API to change. See also [Smith-Pincette-Nitro](https://huggingface.co/Holocortex/Smith-Pincette-Nitro).
19
 
20
  | | |
21
  | :--- | :--- |
22
- | Version | v0.5-preview |
23
- | Parameters | 321.9M |
24
- | Encoder | [`jhu-clsp/mmBERT-base`](https://huggingface.co/jhu-clsp/mmBERT-base) + Smith-Pincette span heads |
25
  | Classes | 43 (table below) |
26
- | Input | any length; processed in 512-token windows with 64-token overlap |
27
  | Output | character-offset spans `(start, end, label, score)`, non-overlapping |
28
  | Format | ONNX, runs with onnxruntime on CPU or CUDA GPU, fully local |
29
  | License | Apache-2.0 |
@@ -37,7 +37,7 @@ pip install "git+https://github.com/holocortex/Smith-Pincette-Models"
37
  ```python
38
  from smith_pincette import SmithPincette
39
 
40
- model = SmithPincette.from_pretrained("Holocortex/Smith-Pincette-Sprint", revision="v0.5-preview")
41
 
42
  text = "Please refund Maria Schneider (maria.schneider@example.com), IBAN DE89 3704 0044 0532 0130 00."
43
  for span in model.detect(text):
@@ -63,13 +63,12 @@ More examples (CLI masking, JSONL batches, reversible masking for LLM prompts, a
63
  | Organization, health | `organization`, `medical_condition` |
64
  | Dates, time, numbers | `date`, `time`, `quantity` |
65
 
66
- `model.detect(text, labels={"email", "iban"})` keeps only some classes. Every class has its own calibrated threshold;
67
- `model.detect(text, threshold=0.4)` replaces them with one flat cutoff.
68
 
69
  ## How it works
70
 
71
- A multilingual encoder with span-extraction heads, shipped as one ONNX graph. Decoding applies calibrated per-class
72
- thresholds and returns the best non-overlapping set of spans.
73
 
74
  ## Intended use and limitations
75
 
@@ -80,21 +79,24 @@ thresholds and returns the best non-overlapping set of spans.
80
  - The credential classes (`password`, `secret_key`, `jwt_token`, `private_key`, `hostname_or_endpoint`) are
81
  experimental in this preview and miss many values, especially in config and log lines. Do not use the model as a
82
  secret scanner.
 
83
  - Best covered languages are English and German; other languages work to a lesser degree.
84
 
85
  ## Training data
86
 
87
- About 230,000 documents, none of them collected from real people:
88
 
89
  - **Generated documents** (most of the data): fully generated templates for tickets, forms, emails, chats, logs,
90
- contracts and similar texts, filled with synthetic values (names, addresses, IDs, bank details, ...), and documents
91
- written by [Qwen3.8-27B](https://huggingface.co/Qwen) (Apache-2.0) in several languages.
92
- - **Wikipedia passages** in several languages, as real-world text, labeled automatically.
 
93
  Wikipedia content is available under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/); we thank
94
  the Wikipedia contributors.
95
  - **Labels** come from the generators themselves and from automatic annotation by Apache-2.0 models.
96
 
97
- No benchmark test data was used for training; overlap with public benchmarks was checked and is zero.
 
98
 
99
  ## Files
100
 
@@ -112,4 +114,4 @@ Provided as is, without support or warranty. Bug reports are welcome as
112
 
113
  ## License
114
 
115
- Apache-2.0. The encoder weights it builds on (`jhu-clsp/mmBERT-base`) are MIT-licensed.
 
2
  license: apache-2.0
3
  library_name: smith-pincette
4
  pipeline_tag: token-classification
5
+ base_model: jhu-clsp/mmBERT-small
6
  tags:
7
  - pii-detection
8
  - span-extraction
 
11
  - onnx
12
  ---
13
 
14
+ # Smith-Pincette-Sprint v0.55
15
 
16
  Part of the **Smith-Pincette Model Family**: compact models that extract exact spans of personal data (names, contact details, addresses,
17
+ ID and bank numbers, and more) from text, so it can be masked before it reaches logs, LLMs or third parties. Smith-Pincette-Sprint is a new architecture on the same small encoder as Nitro, with the same 43 classes.
18
  **This is a preview release**: expect rough edges, and expect the models and API to change. See also [Smith-Pincette-Nitro](https://huggingface.co/Holocortex/Smith-Pincette-Nitro).
19
 
20
  | | |
21
  | :--- | :--- |
22
+ | Version | v0.55 |
23
+ | Parameters | 150.5M |
24
+ | Encoder | [`jhu-clsp/mmBERT-small`](https://huggingface.co/jhu-clsp/mmBERT-small) + Smith-Pincette span heads |
25
  | Classes | 43 (table below) |
26
+ | Input | any length; processed in 512-token windows with 128-token overlap |
27
  | Output | character-offset spans `(start, end, label, score)`, non-overlapping |
28
  | Format | ONNX, runs with onnxruntime on CPU or CUDA GPU, fully local |
29
  | License | Apache-2.0 |
 
37
  ```python
38
  from smith_pincette import SmithPincette
39
 
40
+ model = SmithPincette.from_pretrained("Holocortex/Smith-Pincette-Sprint", revision="v0.55")
41
 
42
  text = "Please refund Maria Schneider (maria.schneider@example.com), IBAN DE89 3704 0044 0532 0130 00."
43
  for span in model.detect(text):
 
63
  | Organization, health | `organization`, `medical_condition` |
64
  | Dates, time, numbers | `date`, `time`, `quantity` |
65
 
66
+ `model.detect(text, labels={"email", "iban"})` keeps only some classes. Every class uses a threshold of 0.5;
67
+ `model.detect(text, threshold=0.4)` sets one flat cutoff instead.
68
 
69
  ## How it works
70
 
71
+ A multilingual encoder with span-extraction heads, shipped as one ONNX graph. Decoding scores up to 64 candidates per window, adjusts their boundaries, and removes overlaps (highest score wins).
 
72
 
73
  ## Intended use and limitations
74
 
 
79
  - The credential classes (`password`, `secret_key`, `jwt_token`, `private_key`, `hostname_or_endpoint`) are
80
  experimental in this preview and miss many values, especially in config and log lines. Do not use the model as a
81
  secret scanner.
82
+ - It returns **at most 64 spans per 512-token window**: values beyond that in very dense text (such as long customer lists) are missed. Split such text into smaller records.
83
  - Best covered languages are English and German; other languages work to a lesser degree.
84
 
85
  ## Training data
86
 
87
+ Synthetic documents plus real public text:
88
 
89
  - **Generated documents** (most of the data): fully generated templates for tickets, forms, emails, chats, logs,
90
+ contracts, invoices and similar texts, filled with synthetic values (names, addresses, IDs, bank details, secrets, ...),
91
+ and documents and chats written by [Qwen3.8-27B](https://huggingface.co/Qwen) (Apache-2.0) in several languages.
92
+ - **Public text, labeled automatically**: Wikipedia, FineWeb / FineWeb-2 and FineWeb-Edu, CC-News, arXiv and PubMed abstracts,
93
+ Project Gutenberg books and Stack Exchange posts. This text is not distributed with the model.
94
  Wikipedia content is available under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/); we thank
95
  the Wikipedia contributors.
96
  - **Labels** come from the generators themselves and from automatic annotation by Apache-2.0 models.
97
 
98
+ No benchmark test data was used for training on purpose, and no training document is identical to a document of the public
99
+ benchmarks we check. Some short lines (such as boilerplate and formulaic phrases) occur in both.
100
 
101
  ## Files
102
 
 
114
 
115
  ## License
116
 
117
+ Apache-2.0. The encoder weights it builds on (`jhu-clsp/mmBERT-small`) are MIT-licensed.
calibrated_thresholds.json CHANGED
@@ -1,45 +1,45 @@
1
  {
2
- "account_id": 0.25,
3
- "age": 0.75,
4
- "bank_account": 0.05,
5
- "card_cvv": 0.65,
6
- "card_expiry": 0.05,
7
- "city": 0.8,
8
- "coordinate": 0.25,
9
- "country": 0.2,
10
- "credit_card_number": 0.25,
11
- "crypto_address": 0.05,
12
- "currency": 0.05,
13
- "date": 0.5,
14
- "date_of_birth": 0.45,
15
- "drivers_license_number": 0.25,
16
- "education_level": 0.25,
17
- "email": 0.55,
18
- "gender": 0.4,
19
- "hostname_or_endpoint": 0.2,
20
- "iban": 0.05,
21
- "ip_address": 0.8,
22
- "jwt_token": 0.1,
23
- "license_number": 0.8,
24
- "mac_address": 0.25,
25
- "medical_condition": 0.05,
26
- "national_id": 0.55,
27
- "nationality": 0.05,
28
- "occupation": 0.75,
29
- "organization": 0.1,
30
- "passport_number": 0.05,
31
- "password": 0.05,
32
- "person": 0.05,
33
- "phone_number": 0.45,
34
- "postal_code": 0.25,
35
- "private_key": 0.25,
36
- "quantity": 0.1,
37
- "routing_number": 0.8,
38
- "secret_key": 0.6,
39
- "ssn": 0.25,
40
- "state_or_region": 0.2,
41
- "street_address": 0.15,
42
- "tax_id": 0.3,
43
- "time": 0.1,
44
- "username": 0.5
45
  }
 
1
  {
2
+ "ssn": 0.5,
3
+ "national_id": 0.5,
4
+ "passport_number": 0.5,
5
+ "drivers_license_number": 0.5,
6
+ "license_number": 0.5,
7
+ "tax_id": 0.5,
8
+ "credit_card_number": 0.5,
9
+ "card_expiry": 0.5,
10
+ "card_cvv": 0.5,
11
+ "iban": 0.5,
12
+ "bank_account": 0.5,
13
+ "routing_number": 0.5,
14
+ "password": 0.5,
15
+ "secret_key": 0.5,
16
+ "jwt_token": 0.5,
17
+ "private_key": 0.5,
18
+ "hostname_or_endpoint": 0.5,
19
+ "person": 0.5,
20
+ "date_of_birth": 0.5,
21
+ "email": 0.5,
22
+ "phone_number": 0.5,
23
+ "date": 0.5,
24
+ "street_address": 0.5,
25
+ "city": 0.5,
26
+ "state_or_region": 0.5,
27
+ "postal_code": 0.5,
28
+ "country": 0.5,
29
+ "medical_condition": 0.5,
30
+ "ip_address": 0.5,
31
+ "username": 0.5,
32
+ "account_id": 0.5,
33
+ "organization": 0.5,
34
+ "occupation": 0.5,
35
+ "age": 0.5,
36
+ "gender": 0.5,
37
+ "time": 0.5,
38
+ "quantity": 0.5,
39
+ "crypto_address": 0.5,
40
+ "mac_address": 0.5,
41
+ "currency": 0.5,
42
+ "education_level": 0.5,
43
+ "nationality": 0.5,
44
+ "coordinate": 0.5
45
  }
config.json CHANGED
@@ -1,5 +1,8 @@
1
  {
 
2
  "max_tokens": 512,
 
 
3
  "pad_id": 0,
4
  "labels": [
5
  [
@@ -173,90 +176,6 @@
173
  [
174
  "coordinate",
175
  "coordinate"
176
- ],
177
- [
178
- "query_43",
179
- "query_43"
180
- ],
181
- [
182
- "query_44",
183
- "query_44"
184
- ],
185
- [
186
- "query_45",
187
- "query_45"
188
- ],
189
- [
190
- "query_46",
191
- "query_46"
192
- ],
193
- [
194
- "query_47",
195
- "query_47"
196
- ],
197
- [
198
- "query_48",
199
- "query_48"
200
- ],
201
- [
202
- "query_49",
203
- "query_49"
204
- ],
205
- [
206
- "query_50",
207
- "query_50"
208
- ],
209
- [
210
- "query_51",
211
- "query_51"
212
- ],
213
- [
214
- "query_52",
215
- "query_52"
216
- ],
217
- [
218
- "query_53",
219
- "query_53"
220
- ],
221
- [
222
- "query_54",
223
- "query_54"
224
- ],
225
- [
226
- "query_55",
227
- "query_55"
228
- ],
229
- [
230
- "query_56",
231
- "query_56"
232
- ],
233
- [
234
- "query_57",
235
- "query_57"
236
- ],
237
- [
238
- "query_58",
239
- "query_58"
240
- ],
241
- [
242
- "query_59",
243
- "query_59"
244
- ],
245
- [
246
- "query_60",
247
- "query_60"
248
- ],
249
- [
250
- "query_61",
251
- "query_61"
252
- ],
253
- [
254
- "query_62",
255
- "query_62"
256
- ],
257
- [
258
- "query_63",
259
- "query_63"
260
  ]
261
  ]
262
  }
 
1
  {
2
+ "decoder": "candidates",
3
  "max_tokens": 512,
4
+ "overlap": 128,
5
+ "byte_window": 16,
6
  "pad_id": 0,
7
  "labels": [
8
  [
 
176
  [
177
  "coordinate",
178
  "coordinate"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  ]
180
  ]
181
  }
model.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c82f19b3e7344413da1140db6df9e5c024d0e11f8bf3cd2985055b810a4166e8
3
- size 1293395393
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:715974af629ef3ab4a2f75b6fd169a31e1f50d9c070b2db3d728cb4e73a7f216
3
+ size 600389273