sumeshi commited on
Commit
fb7569f
·
verified ·
1 Parent(s): c988362

card: sync from privacy-filter.cpp (privacy-filter-jp.md)

Browse files
Files changed (1) hide show
  1. README.md +58 -37
README.md CHANGED
@@ -42,71 +42,92 @@ production guarantee.
42
 
43
  ## Training Summary
44
 
45
- Release candidate trained locally on 2026-07-02:
46
 
47
  - base: multilingual privacy-filter compatible checkpoint
48
- - final checkpoint: `runs/pf-jp/model-ft-balanced-v2`
49
- - stage 1: balanced fine-tune, 1 epoch, learning rate `1e-4`
50
- - stage 2: boundary refresh, 0.5 epoch, learning rate `5e-5`
51
- - batch size: 8
52
- - max length: 96
53
- - GGUF: `privacy-filter-jp-f16.gguf`
54
- - GGUF sha256: `b800ec1a756640f181c97773586673574e4146414af96b77b6f5ebbb6b02f8da`
 
55
 
56
- Training data summary:
57
 
58
  - small in-repository benchmark train split
59
  - synthetic Japanese address examples using public Japan Post postal-code data
60
  as area-level material plus fabricated street/building/room details
61
  - synthetic Japanese date and account-number examples
62
  - synthetic structured PII examples for email, phone, URL, and secret
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  - synthetic Japanese boundary examples for honorifics, roles, URL prefixes, and
64
  multi-address text
65
  - converted Japanese person-name NER examples
66
 
67
  No real PII is intentionally used.
68
 
69
- ## Initial Benchmark
70
 
71
- The bundled benchmark is small and intended as an initial smoke/regression
72
- check. It should not be read as production accuracy.
 
 
 
 
 
73
 
74
- Important caveat: during this initial iteration, `challenge` errors were used to
75
- diagnose boundary issues before the v2 fine-tune. The challenge numbers below
76
- are not a blind held-out score.
 
 
77
 
78
- Challenge smoke result:
 
 
79
 
80
- | group | baseline F1 | FT v2 F1 | FT v2 partial-fn |
81
- | --- | ---: | ---: | ---: |
82
- | `private_person` | 0.583 | 0.917 | 1 |
83
- | `private_address` | 0.400 | 1.000 | 0 |
84
- | other 6 labels | 0.400 | 0.833 | 1 |
85
- | micro | 0.475 | 0.929 | 2 |
86
-
87
- Label-level FT v2 result on `datasets/benchmark/challenge.jsonl`:
88
 
89
  | label | precision | recall | F1 | partial-fn |
90
  | --- | ---: | ---: | ---: | ---: |
91
- | `account_number` | 1.000 | 1.000 | 1.000 | 0 |
92
- | `private_address` | 1.000 | 1.000 | 1.000 | 0 |
93
- | `private_date` | 1.000 | 1.000 | 1.000 | 0 |
94
- | `private_email` | 1.000 | 1.000 | 1.000 | 0 |
95
- | `private_person` | 0.917 | 0.917 | 0.917 | 1 |
96
- | `private_phone` | 1.000 | 1.000 | 1.000 | 0 |
97
- | `private_url` | 0.000 | 0.000 | 0.000 | 1 |
98
- | `secret` | 1.000 | 1.000 | 1.000 | 0 |
99
- | micro | 0.929 | 0.929 | 0.929 | 2 |
100
-
101
- The `private_url` miss is an exact-boundary miss on a tiny split. Use
 
102
  deterministic detectors for URLs, email addresses, phone numbers, IDs, and
103
  secrets when those spans are high-risk.
104
 
105
  ## Limitations
106
 
107
- - Experimental initial checkpoint.
108
  - Primary target is Japanese text; English is not benchmarked here.
109
- - Benchmark is small and partly diagnostic, not a blind production benchmark.
 
 
 
 
110
  - Does not guarantee complete anonymization.
111
  - Validate on your own data before use in any workflow that affects privacy,
112
  compliance, or security.
 
42
 
43
  ## Training Summary
44
 
45
+ v2 release candidate trained locally on 2026-07-03:
46
 
47
  - base: multilingual privacy-filter compatible checkpoint
48
+ - final checkpoint: `runs/pf-jp/model-ft-v2b`
49
+ - one-shot fine-tune from the base model (no incremental stages): 3 epochs,
50
+ learning rate `1e-4`, batch size 8, max length 384
51
+ - label space unchanged from the base model (no new classifier rows; Japanese
52
+ identifiers are aliased into `account_number`), so model size and inference
53
+ speed are identical to v1
54
+ - GGUF f16 sha256: `e2bafc05ef7e6beb354e78cd77c8cfb5101d55044f23b2cdf343731a882f3b1c`
55
+ - GGUF q8 (experts-only Q8_0) sha256: `de9499518ade053d65d20c2eaae2833954e114d29dd77fa7466dade782da9cd6`
56
 
57
+ Training data summary (~34,000 rows, all offsets machine-validated):
58
 
59
  - small in-repository benchmark train split
60
  - synthetic Japanese address examples using public Japan Post postal-code data
61
  as area-level material plus fabricated street/building/room details
62
  - synthetic Japanese date and account-number examples
63
  - synthetic structured PII examples for email, phone, URL, and secret
64
+ - synthetic Japanese phone numbers in all common formats (mobile / landline
65
+ with 2–4 digit area codes / 0120 / 0570 / +81 / fullwidth digits /
66
+ parentheses / no separators) and Japan-specific identifiers (My Number,
67
+ driver's license, passport, pension, health insurance, bank and yucho
68
+ accounts, residence card) labeled as `account_number`
69
+ - synthetic ordinary Japanese person names (kanji/kana/romaji, furigana pairs,
70
+ joint names, honorific and title boundaries)
71
+ - synthetic long multi-PII business documents (150–600 chars: emails with
72
+ signature blocks, application forms, support logs, delivery notes, minutes,
73
+ incident reports)
74
+ - key=value log / .env / HTTP-header style PII lines
75
+ - PII-free negative rows (prices, model numbers, versions, error codes) to
76
+ suppress over-detection
77
  - synthetic Japanese boundary examples for honorifics, roles, URL prefixes, and
78
  multi-address text
79
  - converted Japanese person-name NER examples
80
 
81
  No real PII is intentionally used.
82
 
83
+ ## Benchmark
84
 
85
+ Exact-match span micro F1, measured with the runtime span post-processing that
86
+ ships with `privacy-filter.cpp` (edge trimming and person-span splitting).
87
+ The v2 benchmark (`datasets/benchmark/{eval2,challenge2}.jsonl`, 106
88
+ hand-written examples) targets realistic multi-paragraph business documents,
89
+ Japanese phone-format variants, Japan-specific identifiers, furigana name
90
+ pairs, and PII-free negatives. `challenge2` is kept blind: it is never used
91
+ for tuning or per-row error analysis.
92
 
93
+ | benchmark | v1 model | v2 model |
94
+ | --- | ---: | ---: |
95
+ | `eval2` (realistic documents) | 0.400 | 0.717 |
96
+ | `challenge2` (blind held-out) | 0.453 | 0.693 |
97
+ | `challenge` (v1 split, regression) | 0.912 | 0.964 |
98
 
99
+ The v1 split numbers previously published (0.929 overall) predate this
100
+ pipeline and were optimistic: the v1 boundary training data shared
101
+ template-generated texts with the v1 `eval`/`challenge` splits.
102
 
103
+ Label-level v2 result on `eval2.jsonl`:
 
 
 
 
 
 
 
104
 
105
  | label | precision | recall | F1 | partial-fn |
106
  | --- | ---: | ---: | ---: | ---: |
107
+ | `account_number` | 0.625 | 0.625 | 0.625 | 5 |
108
+ | `private_address` | 0.700 | 0.875 | 0.778 | 1 |
109
+ | `private_date` | 0.643 | 0.643 | 0.643 | 5 |
110
+ | `private_email` | 0.333 | 0.333 | 0.333 | 4 |
111
+ | `private_person` | 0.793 | 0.821 | 0.807 | 4 |
112
+ | `private_phone` | 0.917 | 0.917 | 0.917 | 1 |
113
+ | `private_url` | 0.500 | 0.500 | 0.500 | 3 |
114
+ | `secret` | 0.667 | 1.000 | 0.800 | 0 |
115
+ | micro | 0.696 | 0.740 | 0.717 | 23 |
116
+
117
+ Most remaining false negatives are partial (boundary differences on detected
118
+ entities rather than complete misses; see the `partial-fn` column). Use
119
  deterministic detectors for URLs, email addresses, phone numbers, IDs, and
120
  secrets when those spans are high-risk.
121
 
122
  ## Limitations
123
 
124
+ - Experimental checkpoint.
125
  - Primary target is Japanese text; English is not benchmarked here.
126
+ - Benchmarks are small and do not represent production accuracy.
127
+ - Known gaps: dates at the head of numbered list items ("5. 2026年7月3日、")
128
+ can fall below threshold; identifiers in key=value log lines are sometimes
129
+ labeled as a different PII category than expected (still redacted); email
130
+ span boundaries in long documents are the weakest label.
131
  - Does not guarantee complete anonymization.
132
  - Validate on your own data before use in any workflow that affects privacy,
133
  compliance, or security.