ankitcodes commited on
Commit
779ad59
1 Parent(s): 9933ccb

Upload 5 files

Browse files
Files changed (5) hide show
  1. README.md +144 -0
  2. config.json +256 -0
  3. model.safetensors +3 -0
  4. special_tokens_map.json +7 -0
  5. tokenizer.json +0 -0
README.md CHANGED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: bert-base-cased
4
+ tags:
5
+ - PII
6
+ - NER
7
+ - Bert
8
+ - Token Classification
9
+ datasets:
10
+ - generator
11
+ metrics:
12
+ - precision
13
+ - recall
14
+ - f1
15
+ - accuracy
16
+ model-index:
17
+ - name: pii_model
18
+ results:
19
+ - task:
20
+ name: Token Classification
21
+ type: token-classification
22
+ dataset:
23
+ name: generator
24
+ type: generator
25
+ config: default
26
+ split: train
27
+ args: default
28
+ metrics:
29
+ - name: Precision
30
+ type: precision
31
+ value: 0.954751
32
+ - name: Recall
33
+ type: recall
34
+ value: 0.965233
35
+ - name: F1
36
+ type: f1
37
+ value: 0.959964
38
+ - name: Accuracy
39
+ type: accuracy
40
+ value: 0.991199
41
+ pipeline_tag: token-classification
42
+ language:
43
+ - en
44
+ ---
45
+
46
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
47
+ should probably proofread and complete it, then remove this comment. -->
48
+
49
+ # Personal Identifiable Information (PII Model)
50
+
51
+ This model is a fine-tuned version of [bert-base-cased](https://huggingface.co/bert-base-cased) on the generator dataset.
52
+ It achieves the following results:
53
+
54
+ - Training Loss: 0.003900
55
+ - Validation Loss: 0.051071
56
+ - Precision: 95.53%
57
+ - Recall: 96.60%
58
+ - F1: 96%
59
+ - Accuracy:99.11%
60
+
61
+ ## Model description
62
+
63
+ Meet our digital safeguard, a savvy token classification model with a knack for spotting personally identifiable information (PII) entities. Trained on the illustrious Bert architecture and fine-tuned on a custom dataset, this model is like a superhero for privacy, swiftly detecting names, addresses, dates of birth, and more. With each token it encounters, it acts as a vigilant guardian, ensuring that sensitive information remains shielded from prying eyes, making the digital realm a safer and more secure place to explore.
64
+
65
+ ## Model can Detect Following Entity Group
66
+
67
+ - ACCOUNTNUMBER
68
+ - FIRSTNAME
69
+ - ACCOUNTNAME
70
+ - PHONENUMBER
71
+ - CREDITCARDCVV
72
+ - CREDITCARDISSUER
73
+ - PREFIX
74
+ - LASTNAME
75
+ - AMOUNT
76
+ - DATE
77
+ - DOB
78
+ - COMPANYNAME
79
+ - BUILDINGNUMBER
80
+ - STREET
81
+ - SECONDARYADDRESS
82
+ - STATE
83
+ - EMAIL
84
+ - CITY
85
+ - CREDITCARDNUMBER
86
+ - SSN
87
+ - URL
88
+ - USERNAME
89
+ - PASSWORD
90
+ - COUNTY
91
+ - PIN
92
+ - MIDDLENAME
93
+ - IBAN
94
+ - GENDER
95
+ - AGE
96
+ - ZIPCODE
97
+ - SEX
98
+
99
+
100
+
101
+
102
+ ### Training hyperparameters
103
+ The following hyperparameters were used during training:
104
+
105
+ | Hyperparameter | Value |
106
+ |------------------------------|---------------|
107
+ | Learning Rate | 5e-5 |
108
+ | Train Batch Size | 16 |
109
+ | Eval Batch Size | 16 |
110
+ | Number of Training Epochs | 7 |
111
+ | Weight Decay | 0.01 |
112
+ | Save Strategy | Epoch |
113
+ | Load Best Model at End | True |
114
+ | Metric for Best Model | F1 |
115
+ | Push to Hub | True |
116
+ | Evaluation Strategy | Epoch |
117
+ | Early Stopping Patience | 3 |
118
+
119
+
120
+ ### Training results
121
+
122
+ | Epoch | Training Loss | Validation Loss | Precision (%) | Recall (%) | F1 Score (%) | Accuracy (%) |
123
+ |-------|---------------|-----------------|---------------|------------|--------------|--------------|
124
+ | 1 | 0.0443 | 0.038108 | 91.88 | 95.17 | 93.50 | 98.80 |
125
+ | 2 | 0.0318 | 0.035728 | 94.13 | 96.15 | 95.13 | 98.90 |
126
+ | 3 | 0.0209 | 0.032016 | 94.81 | 96.42 | 95.61 | 99.01 |
127
+ | 4 | 0.0154 | 0.040221 | 93.87 | 95.80 | 94.82 | 98.88 |
128
+ | 5 | 0.0084 | 0.048183 | 94.21 | 96.06 | 95.13 | 98.93 |
129
+ | 6 | 0.0037 | 0.052281 | 94.49 | 96.60 | 95.53 | 99.07 |
130
+
131
+
132
+
133
+
134
+
135
+
136
+ ### Author
137
+ abhijeet__@outlook.com
138
+
139
+ ### Framework versions
140
+
141
+ - Transformers 4.38.2
142
+ - Pytorch 2.1.0+cu121
143
+ - Datasets 2.18.0
144
+ - Tokenizers 0.15.2
config.json ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "google-bert/bert-base-uncased",
3
+ "architectures": [
4
+ "BertForTokenClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "id2label": {
13
+ "0": "O",
14
+ "1": "B-PASSWORD",
15
+ "2": "I-PASSWORD",
16
+ "3": "B-CITY",
17
+ "4": "I-CITY",
18
+ "5": "B-SEX",
19
+ "6": "I-SEX",
20
+ "7": "B-IPV4",
21
+ "8": "I-IPV4",
22
+ "9": "B-JOBTITLE",
23
+ "10": "I-JOBTITLE",
24
+ "11": "B-COUNTY",
25
+ "12": "I-COUNTY",
26
+ "13": "B-PREFIX",
27
+ "14": "I-PREFIX",
28
+ "15": "B-LASTNAME",
29
+ "16": "I-LASTNAME",
30
+ "17": "B-ACCOUNTNUMBER",
31
+ "18": "I-ACCOUNTNUMBER",
32
+ "19": "B-USERNAME",
33
+ "20": "I-USERNAME",
34
+ "21": "B-PHONENUMBER",
35
+ "22": "I-PHONENUMBER",
36
+ "23": "B-FIRSTNAME",
37
+ "24": "I-FIRSTNAME",
38
+ "25": "B-DATE",
39
+ "26": "I-DATE",
40
+ "27": "B-JOBTYPE",
41
+ "28": "I-JOBTYPE",
42
+ "29": "B-COMPANYNAME",
43
+ "30": "I-COMPANYNAME",
44
+ "31": "B-JOBAREA",
45
+ "32": "I-JOBAREA",
46
+ "33": "B-ZIPCODE",
47
+ "34": "I-ZIPCODE",
48
+ "35": "B-CREDITCARDISSUER",
49
+ "36": "I-CREDITCARDISSUER",
50
+ "37": "B-STATE",
51
+ "38": "I-STATE",
52
+ "39": "B-IPV6",
53
+ "40": "I-IPV6",
54
+ "41": "B-SSN",
55
+ "42": "I-SSN",
56
+ "43": "B-CREDITCARDNUMBER",
57
+ "44": "I-CREDITCARDNUMBER",
58
+ "45": "B-MIDDLENAME",
59
+ "46": "I-MIDDLENAME",
60
+ "47": "B-PHONEIMEI",
61
+ "48": "I-PHONEIMEI",
62
+ "49": "B-DOB",
63
+ "50": "I-DOB",
64
+ "51": "B-SECONDARYADDRESS",
65
+ "52": "I-SECONDARYADDRESS",
66
+ "53": "B-ETHEREUMADDRESS",
67
+ "54": "I-ETHEREUMADDRESS",
68
+ "55": "B-EMAIL",
69
+ "56": "I-EMAIL",
70
+ "57": "B-ORDINALDIRECTION",
71
+ "58": "I-ORDINALDIRECTION",
72
+ "59": "B-CURRENCY",
73
+ "60": "I-CURRENCY",
74
+ "61": "B-BUILDINGNUMBER",
75
+ "62": "I-BUILDINGNUMBER",
76
+ "63": "B-STREET",
77
+ "64": "I-STREET",
78
+ "65": "B-HEIGHT",
79
+ "66": "I-HEIGHT",
80
+ "67": "B-EYECOLOR",
81
+ "68": "I-EYECOLOR",
82
+ "69": "B-NEARBYGPSCOORDINATE",
83
+ "70": "I-NEARBYGPSCOORDINATE",
84
+ "71": "B-URL",
85
+ "72": "I-URL",
86
+ "73": "B-BITCOINADDRESS",
87
+ "74": "I-BITCOINADDRESS",
88
+ "75": "B-IP",
89
+ "76": "I-IP",
90
+ "77": "B-GENDER",
91
+ "78": "I-GENDER",
92
+ "79": "B-AMOUNT",
93
+ "80": "I-AMOUNT",
94
+ "81": "B-AGE",
95
+ "82": "I-AGE",
96
+ "83": "B-MASKEDNUMBER",
97
+ "84": "I-MASKEDNUMBER",
98
+ "85": "B-CREDITCARDCVV",
99
+ "86": "I-CREDITCARDCVV",
100
+ "87": "B-VEHICLEVRM",
101
+ "88": "I-VEHICLEVRM",
102
+ "89": "B-VEHICLEVIN",
103
+ "90": "I-VEHICLEVIN",
104
+ "91": "B-MAC",
105
+ "92": "I-MAC",
106
+ "93": "B-ACCOUNTNAME",
107
+ "94": "I-ACCOUNTNAME",
108
+ "95": "B-USERAGENT",
109
+ "96": "I-USERAGENT",
110
+ "97": "B-LITECOINADDRESS",
111
+ "98": "I-LITECOINADDRESS",
112
+ "99": "B-TIME",
113
+ "100": "I-TIME",
114
+ "101": "B-IBAN",
115
+ "102": "I-IBAN",
116
+ "103": "B-CURRENCYSYMBOL",
117
+ "104": "I-CURRENCYSYMBOL",
118
+ "105": "B-BIC",
119
+ "106": "I-BIC",
120
+ "107": "B-CURRENCYNAME",
121
+ "108": "I-CURRENCYNAME",
122
+ "109": "B-CURRENCYCODE",
123
+ "110": "I-CURRENCYCODE",
124
+ "111": "B-PIN",
125
+ "112": "I-PIN"
126
+ },
127
+ "initializer_range": 0.02,
128
+ "intermediate_size": 3072,
129
+ "label2id": {
130
+ "B-ACCOUNTNAME": 93,
131
+ "B-ACCOUNTNUMBER": 17,
132
+ "B-AGE": 81,
133
+ "B-AMOUNT": 79,
134
+ "B-BIC": 105,
135
+ "B-BITCOINADDRESS": 73,
136
+ "B-BUILDINGNUMBER": 61,
137
+ "B-CITY": 3,
138
+ "B-COMPANYNAME": 29,
139
+ "B-COUNTY": 11,
140
+ "B-CREDITCARDCVV": 85,
141
+ "B-CREDITCARDISSUER": 35,
142
+ "B-CREDITCARDNUMBER": 43,
143
+ "B-CURRENCY": 59,
144
+ "B-CURRENCYCODE": 109,
145
+ "B-CURRENCYNAME": 107,
146
+ "B-CURRENCYSYMBOL": 103,
147
+ "B-DATE": 25,
148
+ "B-DOB": 49,
149
+ "B-EMAIL": 55,
150
+ "B-ETHEREUMADDRESS": 53,
151
+ "B-EYECOLOR": 67,
152
+ "B-FIRSTNAME": 23,
153
+ "B-GENDER": 77,
154
+ "B-HEIGHT": 65,
155
+ "B-IBAN": 101,
156
+ "B-IP": 75,
157
+ "B-IPV4": 7,
158
+ "B-IPV6": 39,
159
+ "B-JOBAREA": 31,
160
+ "B-JOBTITLE": 9,
161
+ "B-JOBTYPE": 27,
162
+ "B-LASTNAME": 15,
163
+ "B-LITECOINADDRESS": 97,
164
+ "B-MAC": 91,
165
+ "B-MASKEDNUMBER": 83,
166
+ "B-MIDDLENAME": 45,
167
+ "B-NEARBYGPSCOORDINATE": 69,
168
+ "B-ORDINALDIRECTION": 57,
169
+ "B-PASSWORD": 1,
170
+ "B-PHONEIMEI": 47,
171
+ "B-PHONENUMBER": 21,
172
+ "B-PIN": 111,
173
+ "B-PREFIX": 13,
174
+ "B-SECONDARYADDRESS": 51,
175
+ "B-SEX": 5,
176
+ "B-SSN": 41,
177
+ "B-STATE": 37,
178
+ "B-STREET": 63,
179
+ "B-TIME": 99,
180
+ "B-URL": 71,
181
+ "B-USERAGENT": 95,
182
+ "B-USERNAME": 19,
183
+ "B-VEHICLEVIN": 89,
184
+ "B-VEHICLEVRM": 87,
185
+ "B-ZIPCODE": 33,
186
+ "I-ACCOUNTNAME": 94,
187
+ "I-ACCOUNTNUMBER": 18,
188
+ "I-AGE": 82,
189
+ "I-AMOUNT": 80,
190
+ "I-BIC": 106,
191
+ "I-BITCOINADDRESS": 74,
192
+ "I-BUILDINGNUMBER": 62,
193
+ "I-CITY": 4,
194
+ "I-COMPANYNAME": 30,
195
+ "I-COUNTY": 12,
196
+ "I-CREDITCARDCVV": 86,
197
+ "I-CREDITCARDISSUER": 36,
198
+ "I-CREDITCARDNUMBER": 44,
199
+ "I-CURRENCY": 60,
200
+ "I-CURRENCYCODE": 110,
201
+ "I-CURRENCYNAME": 108,
202
+ "I-CURRENCYSYMBOL": 104,
203
+ "I-DATE": 26,
204
+ "I-DOB": 50,
205
+ "I-EMAIL": 56,
206
+ "I-ETHEREUMADDRESS": 54,
207
+ "I-EYECOLOR": 68,
208
+ "I-FIRSTNAME": 24,
209
+ "I-GENDER": 78,
210
+ "I-HEIGHT": 66,
211
+ "I-IBAN": 102,
212
+ "I-IP": 76,
213
+ "I-IPV4": 8,
214
+ "I-IPV6": 40,
215
+ "I-JOBAREA": 32,
216
+ "I-JOBTITLE": 10,
217
+ "I-JOBTYPE": 28,
218
+ "I-LASTNAME": 16,
219
+ "I-LITECOINADDRESS": 98,
220
+ "I-MAC": 92,
221
+ "I-MASKEDNUMBER": 84,
222
+ "I-MIDDLENAME": 46,
223
+ "I-NEARBYGPSCOORDINATE": 70,
224
+ "I-ORDINALDIRECTION": 58,
225
+ "I-PASSWORD": 2,
226
+ "I-PHONEIMEI": 48,
227
+ "I-PHONENUMBER": 22,
228
+ "I-PIN": 112,
229
+ "I-PREFIX": 14,
230
+ "I-SECONDARYADDRESS": 52,
231
+ "I-SEX": 6,
232
+ "I-SSN": 42,
233
+ "I-STATE": 38,
234
+ "I-STREET": 64,
235
+ "I-TIME": 100,
236
+ "I-URL": 72,
237
+ "I-USERAGENT": 96,
238
+ "I-USERNAME": 20,
239
+ "I-VEHICLEVIN": 90,
240
+ "I-VEHICLEVRM": 88,
241
+ "I-ZIPCODE": 34,
242
+ "O": 0
243
+ },
244
+ "layer_norm_eps": 1e-12,
245
+ "max_position_embeddings": 512,
246
+ "model_type": "bert",
247
+ "num_attention_heads": 12,
248
+ "num_hidden_layers": 12,
249
+ "pad_token_id": 0,
250
+ "position_embedding_type": "absolute",
251
+ "torch_dtype": "float32",
252
+ "transformers_version": "4.41.2",
253
+ "type_vocab_size": 2,
254
+ "use_cache": true,
255
+ "vocab_size": 30522
256
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be437b7c21a9143a9585c94ab903515f38d1fc1350e1fc98c195bae0df1f5b81
3
+ size 435937524
special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff