Cbezz commited on
Commit
6d76d77
·
verified ·
1 Parent(s): 45d6fcb

Upload ModernBERT PII NER model

Browse files
Files changed (6) hide show
  1. README.md +50 -0
  2. config.json +176 -0
  3. model.safetensors +3 -0
  4. tokenizer.json +0 -0
  5. tokenizer_config.json +16 -0
  6. training_args.bin +3 -0
README.md ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: answerdotai/ModernBERT-base
4
+ tags:
5
+ - token-classification
6
+ - named-entity-recognition
7
+ - pii
8
+ - modernbert
9
+ language:
10
+ - en
11
+ pipeline_tag: token-classification
12
+ ---
13
+
14
+ # modernbert-pii
15
+
16
+ ModernBERT fine-tuned for token classification (NER) to detect PII in
17
+ Australian clinical notes. Labels use the BIO scheme over these entity types:
18
+
19
+ - `ACD`
20
+ - `ADDRESS`
21
+ - `AGE`
22
+ - `ATTENDING_NURSE`
23
+ - `COUNTRY_OF_BIRTH`
24
+ - `DATE_OF_BIRTH`
25
+ - `DVA_NUMBER`
26
+ - `EMAIL`
27
+ - `FULL_NAME`
28
+ - `GUARDIANSHIP`
29
+ - `IHI`
30
+ - `MEDICARE_NUMBER`
31
+ - `MRN`
32
+ - `NEXT_OF_KIN`
33
+ - `OCCUPATION`
34
+ - `OTHER_CLINICAL_STAFF`
35
+ - `PHONE_NUMBER`
36
+ - `PREFERRED_NAME`
37
+ - `PRIVATE_HEALTH_NUMBER`
38
+ - `REFERRING_GP`
39
+ - `SEX_GENDER`
40
+ - `TREATING_CLINICIAN`
41
+ - `WORKCOVER`
42
+
43
+ ## Usage
44
+
45
+ ```python
46
+ from transformers import pipeline
47
+
48
+ ner = pipeline("token-classification", model="Cbezz/modernbert-pii", aggregation_strategy="simple")
49
+ ner("Patient John Smith, DOB 12/03/1980, MRN 4456219.")
50
+ ```
config.json ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ModernBertForTokenClassification"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": null,
8
+ "classifier_activation": "gelu",
9
+ "classifier_bias": false,
10
+ "classifier_dropout": 0.0,
11
+ "classifier_pooling": "mean",
12
+ "cls_token_id": 50281,
13
+ "decoder_bias": true,
14
+ "deterministic_flash_attn": false,
15
+ "dtype": "float32",
16
+ "embedding_dropout": 0.0,
17
+ "eos_token_id": null,
18
+ "global_attn_every_n_layers": 3,
19
+ "gradient_checkpointing": false,
20
+ "hidden_activation": "gelu",
21
+ "hidden_size": 768,
22
+ "id2label": {
23
+ "0": "O",
24
+ "1": "B-ACD",
25
+ "2": "I-ACD",
26
+ "3": "B-ADDRESS",
27
+ "4": "I-ADDRESS",
28
+ "5": "B-AGE",
29
+ "6": "I-AGE",
30
+ "7": "B-ATTENDING_NURSE",
31
+ "8": "I-ATTENDING_NURSE",
32
+ "9": "B-COUNTRY_OF_BIRTH",
33
+ "10": "I-COUNTRY_OF_BIRTH",
34
+ "11": "B-DATE_OF_BIRTH",
35
+ "12": "I-DATE_OF_BIRTH",
36
+ "13": "B-DVA_NUMBER",
37
+ "14": "I-DVA_NUMBER",
38
+ "15": "B-EMAIL",
39
+ "16": "I-EMAIL",
40
+ "17": "B-FULL_NAME",
41
+ "18": "I-FULL_NAME",
42
+ "19": "B-GUARDIANSHIP",
43
+ "20": "I-GUARDIANSHIP",
44
+ "21": "B-IHI",
45
+ "22": "I-IHI",
46
+ "23": "B-MEDICARE_NUMBER",
47
+ "24": "I-MEDICARE_NUMBER",
48
+ "25": "B-MRN",
49
+ "26": "I-MRN",
50
+ "27": "B-NEXT_OF_KIN",
51
+ "28": "I-NEXT_OF_KIN",
52
+ "29": "B-OCCUPATION",
53
+ "30": "I-OCCUPATION",
54
+ "31": "B-OTHER_CLINICAL_STAFF",
55
+ "32": "I-OTHER_CLINICAL_STAFF",
56
+ "33": "B-PHONE_NUMBER",
57
+ "34": "I-PHONE_NUMBER",
58
+ "35": "B-PREFERRED_NAME",
59
+ "36": "I-PREFERRED_NAME",
60
+ "37": "B-PRIVATE_HEALTH_NUMBER",
61
+ "38": "I-PRIVATE_HEALTH_NUMBER",
62
+ "39": "B-REFERRING_GP",
63
+ "40": "I-REFERRING_GP",
64
+ "41": "B-SEX_GENDER",
65
+ "42": "I-SEX_GENDER",
66
+ "43": "B-TREATING_CLINICIAN",
67
+ "44": "I-TREATING_CLINICIAN",
68
+ "45": "B-WORKCOVER",
69
+ "46": "I-WORKCOVER"
70
+ },
71
+ "initializer_cutoff_factor": 2.0,
72
+ "initializer_range": 0.02,
73
+ "intermediate_size": 1152,
74
+ "label2id": {
75
+ "B-ACD": 1,
76
+ "B-ADDRESS": 3,
77
+ "B-AGE": 5,
78
+ "B-ATTENDING_NURSE": 7,
79
+ "B-COUNTRY_OF_BIRTH": 9,
80
+ "B-DATE_OF_BIRTH": 11,
81
+ "B-DVA_NUMBER": 13,
82
+ "B-EMAIL": 15,
83
+ "B-FULL_NAME": 17,
84
+ "B-GUARDIANSHIP": 19,
85
+ "B-IHI": 21,
86
+ "B-MEDICARE_NUMBER": 23,
87
+ "B-MRN": 25,
88
+ "B-NEXT_OF_KIN": 27,
89
+ "B-OCCUPATION": 29,
90
+ "B-OTHER_CLINICAL_STAFF": 31,
91
+ "B-PHONE_NUMBER": 33,
92
+ "B-PREFERRED_NAME": 35,
93
+ "B-PRIVATE_HEALTH_NUMBER": 37,
94
+ "B-REFERRING_GP": 39,
95
+ "B-SEX_GENDER": 41,
96
+ "B-TREATING_CLINICIAN": 43,
97
+ "B-WORKCOVER": 45,
98
+ "I-ACD": 2,
99
+ "I-ADDRESS": 4,
100
+ "I-AGE": 6,
101
+ "I-ATTENDING_NURSE": 8,
102
+ "I-COUNTRY_OF_BIRTH": 10,
103
+ "I-DATE_OF_BIRTH": 12,
104
+ "I-DVA_NUMBER": 14,
105
+ "I-EMAIL": 16,
106
+ "I-FULL_NAME": 18,
107
+ "I-GUARDIANSHIP": 20,
108
+ "I-IHI": 22,
109
+ "I-MEDICARE_NUMBER": 24,
110
+ "I-MRN": 26,
111
+ "I-NEXT_OF_KIN": 28,
112
+ "I-OCCUPATION": 30,
113
+ "I-OTHER_CLINICAL_STAFF": 32,
114
+ "I-PHONE_NUMBER": 34,
115
+ "I-PREFERRED_NAME": 36,
116
+ "I-PRIVATE_HEALTH_NUMBER": 38,
117
+ "I-REFERRING_GP": 40,
118
+ "I-SEX_GENDER": 42,
119
+ "I-TREATING_CLINICIAN": 44,
120
+ "I-WORKCOVER": 46,
121
+ "O": 0
122
+ },
123
+ "layer_norm_eps": 1e-05,
124
+ "layer_types": [
125
+ "full_attention",
126
+ "sliding_attention",
127
+ "sliding_attention",
128
+ "full_attention",
129
+ "sliding_attention",
130
+ "sliding_attention",
131
+ "full_attention",
132
+ "sliding_attention",
133
+ "sliding_attention",
134
+ "full_attention",
135
+ "sliding_attention",
136
+ "sliding_attention",
137
+ "full_attention",
138
+ "sliding_attention",
139
+ "sliding_attention",
140
+ "full_attention",
141
+ "sliding_attention",
142
+ "sliding_attention",
143
+ "full_attention",
144
+ "sliding_attention",
145
+ "sliding_attention",
146
+ "full_attention"
147
+ ],
148
+ "local_attention": 128,
149
+ "max_position_embeddings": 8192,
150
+ "mlp_bias": false,
151
+ "mlp_dropout": 0.0,
152
+ "model_type": "modernbert",
153
+ "norm_bias": false,
154
+ "norm_eps": 1e-05,
155
+ "num_attention_heads": 12,
156
+ "num_hidden_layers": 22,
157
+ "pad_token_id": 50283,
158
+ "position_embedding_type": "absolute",
159
+ "rope_parameters": {
160
+ "full_attention": {
161
+ "rope_theta": 160000.0,
162
+ "rope_type": "default"
163
+ },
164
+ "sliding_attention": {
165
+ "rope_theta": 10000.0,
166
+ "rope_type": "default"
167
+ }
168
+ },
169
+ "sep_token_id": 50282,
170
+ "sparse_pred_ignore_index": -100,
171
+ "sparse_prediction": false,
172
+ "tie_word_embeddings": true,
173
+ "transformers_version": "5.3.0",
174
+ "use_cache": false,
175
+ "vocab_size": 50368
176
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:415a47eb4646e8cf83e2a2e3c9135ce712e763dd122eff6c394d1fa82a9f3e25
3
+ size 598578212
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "clean_up_tokenization_spaces": true,
4
+ "cls_token": "[CLS]",
5
+ "is_local": false,
6
+ "mask_token": "[MASK]",
7
+ "model_input_names": [
8
+ "input_ids",
9
+ "attention_mask"
10
+ ],
11
+ "model_max_length": 8192,
12
+ "pad_token": "[PAD]",
13
+ "sep_token": "[SEP]",
14
+ "tokenizer_class": "TokenizersBackend",
15
+ "unk_token": "[UNK]"
16
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11f76064b6b389e75db95abcb272d01b3190bff761ce32639bb6df48b5939637
3
+ size 4792