Upload fine-tuned PII detection model
Browse files- README.md +72 -0
- config.json +99 -0
- labels.json +37 -0
- model.safetensors +3 -0
- runs/Apr13_04-04-42_65661a2afab4/events.out.tfevents.1744517090.65661a2afab4.289.0 +3 -0
- runs/Apr13_04-08-50_65661a2afab4/events.out.tfevents.1744517333.65661a2afab4.289.1 +3 -0
- runs/Apr13_04-08-50_65661a2afab4/events.out.tfevents.1744517898.65661a2afab4.289.2 +3 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +56 -0
- training_args.bin +3 -0
- vocab.txt +0 -0
README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: bert-base-uncased
|
| 5 |
+
tags:
|
| 6 |
+
- generated_from_trainer
|
| 7 |
+
metrics:
|
| 8 |
+
- precision
|
| 9 |
+
- recall
|
| 10 |
+
- f1
|
| 11 |
+
model-index:
|
| 12 |
+
- name: pii_bert_model
|
| 13 |
+
results: []
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 17 |
+
should probably proofread and complete it, then remove this comment. -->
|
| 18 |
+
|
| 19 |
+
# pii_bert_model
|
| 20 |
+
|
| 21 |
+
This model is a fine-tuned version of [bert-base-uncased](https://huggingface.co/bert-base-uncased) on an unknown dataset.
|
| 22 |
+
It achieves the following results on the evaluation set:
|
| 23 |
+
- Loss: 0.1020
|
| 24 |
+
- Precision: 0.9748
|
| 25 |
+
- Recall: 0.9744
|
| 26 |
+
- F1: 0.9745
|
| 27 |
+
|
| 28 |
+
## Model description
|
| 29 |
+
|
| 30 |
+
More information needed
|
| 31 |
+
|
| 32 |
+
## Intended uses & limitations
|
| 33 |
+
|
| 34 |
+
More information needed
|
| 35 |
+
|
| 36 |
+
## Training and evaluation data
|
| 37 |
+
|
| 38 |
+
More information needed
|
| 39 |
+
|
| 40 |
+
## Training procedure
|
| 41 |
+
|
| 42 |
+
### Training hyperparameters
|
| 43 |
+
|
| 44 |
+
The following hyperparameters were used during training:
|
| 45 |
+
- learning_rate: 5e-05
|
| 46 |
+
- train_batch_size: 16
|
| 47 |
+
- eval_batch_size: 16
|
| 48 |
+
- seed: 42
|
| 49 |
+
- optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 50 |
+
- lr_scheduler_type: linear
|
| 51 |
+
- num_epochs: 8
|
| 52 |
+
|
| 53 |
+
### Training results
|
| 54 |
+
|
| 55 |
+
| Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 |
|
| 56 |
+
|:-------------:|:-----:|:----:|:---------------:|:---------:|:------:|:------:|
|
| 57 |
+
| 0.1362 | 1.0 | 150 | 0.1090 | 0.9663 | 0.9642 | 0.9645 |
|
| 58 |
+
| 0.0974 | 2.0 | 300 | 0.1192 | 0.9632 | 0.9619 | 0.9620 |
|
| 59 |
+
| 0.0736 | 3.0 | 450 | 0.0867 | 0.9696 | 0.9693 | 0.9693 |
|
| 60 |
+
| 0.0605 | 4.0 | 600 | 0.1111 | 0.9696 | 0.9682 | 0.9685 |
|
| 61 |
+
| 0.0445 | 5.0 | 750 | 0.0895 | 0.9729 | 0.9726 | 0.9726 |
|
| 62 |
+
| 0.0343 | 6.0 | 900 | 0.0952 | 0.9727 | 0.9719 | 0.9721 |
|
| 63 |
+
| 0.023 | 7.0 | 1050 | 0.0991 | 0.9745 | 0.9740 | 0.9741 |
|
| 64 |
+
| 0.0179 | 8.0 | 1200 | 0.1020 | 0.9748 | 0.9744 | 0.9745 |
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
### Framework versions
|
| 68 |
+
|
| 69 |
+
- Transformers 4.50.3
|
| 70 |
+
- Pytorch 2.6.0+cu124
|
| 71 |
+
- Datasets 3.5.0
|
| 72 |
+
- Tokenizers 0.21.1
|
config.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"BertForTokenClassification"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.1,
|
| 6 |
+
"classifier_dropout": null,
|
| 7 |
+
"gradient_checkpointing": false,
|
| 8 |
+
"hidden_act": "gelu",
|
| 9 |
+
"hidden_dropout_prob": 0.1,
|
| 10 |
+
"hidden_size": 768,
|
| 11 |
+
"id2label": {
|
| 12 |
+
"0": "O",
|
| 13 |
+
"1": "B-PER",
|
| 14 |
+
"2": "I-PER",
|
| 15 |
+
"3": "B-EMAIL",
|
| 16 |
+
"4": "I-EMAIL",
|
| 17 |
+
"5": "B-PHONE",
|
| 18 |
+
"6": "I-PHONE",
|
| 19 |
+
"7": "B-LOC",
|
| 20 |
+
"8": "I-LOC",
|
| 21 |
+
"9": "B-DATE",
|
| 22 |
+
"10": "I-DATE",
|
| 23 |
+
"11": "B-SSN",
|
| 24 |
+
"12": "I-SSN",
|
| 25 |
+
"13": "B-CC",
|
| 26 |
+
"14": "I-CC",
|
| 27 |
+
"15": "B-ID",
|
| 28 |
+
"16": "I-ID",
|
| 29 |
+
"17": "B-IP",
|
| 30 |
+
"18": "I-IP",
|
| 31 |
+
"19": "B-URL",
|
| 32 |
+
"20": "I-URL",
|
| 33 |
+
"21": "B-ORG",
|
| 34 |
+
"22": "I-ORG",
|
| 35 |
+
"23": "B-AGE",
|
| 36 |
+
"24": "I-AGE",
|
| 37 |
+
"25": "B-PASSPORT",
|
| 38 |
+
"26": "I-PASSPORT",
|
| 39 |
+
"27": "B-DRIVER",
|
| 40 |
+
"28": "I-DRIVER",
|
| 41 |
+
"29": "B-BANK",
|
| 42 |
+
"30": "I-BANK",
|
| 43 |
+
"31": "B-MEDICAL",
|
| 44 |
+
"32": "I-MEDICAL",
|
| 45 |
+
"33": "B-PLATE",
|
| 46 |
+
"34": "I-PLATE"
|
| 47 |
+
},
|
| 48 |
+
"initializer_range": 0.02,
|
| 49 |
+
"intermediate_size": 3072,
|
| 50 |
+
"label2id": {
|
| 51 |
+
"B-AGE": 23,
|
| 52 |
+
"B-BANK": 29,
|
| 53 |
+
"B-CC": 13,
|
| 54 |
+
"B-DATE": 9,
|
| 55 |
+
"B-DRIVER": 27,
|
| 56 |
+
"B-EMAIL": 3,
|
| 57 |
+
"B-ID": 15,
|
| 58 |
+
"B-IP": 17,
|
| 59 |
+
"B-LOC": 7,
|
| 60 |
+
"B-MEDICAL": 31,
|
| 61 |
+
"B-ORG": 21,
|
| 62 |
+
"B-PASSPORT": 25,
|
| 63 |
+
"B-PER": 1,
|
| 64 |
+
"B-PHONE": 5,
|
| 65 |
+
"B-PLATE": 33,
|
| 66 |
+
"B-SSN": 11,
|
| 67 |
+
"B-URL": 19,
|
| 68 |
+
"I-AGE": 24,
|
| 69 |
+
"I-BANK": 30,
|
| 70 |
+
"I-CC": 14,
|
| 71 |
+
"I-DATE": 10,
|
| 72 |
+
"I-DRIVER": 28,
|
| 73 |
+
"I-EMAIL": 4,
|
| 74 |
+
"I-ID": 16,
|
| 75 |
+
"I-IP": 18,
|
| 76 |
+
"I-LOC": 8,
|
| 77 |
+
"I-MEDICAL": 32,
|
| 78 |
+
"I-ORG": 22,
|
| 79 |
+
"I-PASSPORT": 26,
|
| 80 |
+
"I-PER": 2,
|
| 81 |
+
"I-PHONE": 6,
|
| 82 |
+
"I-PLATE": 34,
|
| 83 |
+
"I-SSN": 12,
|
| 84 |
+
"I-URL": 20,
|
| 85 |
+
"O": 0
|
| 86 |
+
},
|
| 87 |
+
"layer_norm_eps": 1e-12,
|
| 88 |
+
"max_position_embeddings": 512,
|
| 89 |
+
"model_type": "bert",
|
| 90 |
+
"num_attention_heads": 12,
|
| 91 |
+
"num_hidden_layers": 12,
|
| 92 |
+
"pad_token_id": 0,
|
| 93 |
+
"position_embedding_type": "absolute",
|
| 94 |
+
"torch_dtype": "float32",
|
| 95 |
+
"transformers_version": "4.50.3",
|
| 96 |
+
"type_vocab_size": 2,
|
| 97 |
+
"use_cache": true,
|
| 98 |
+
"vocab_size": 30522
|
| 99 |
+
}
|
labels.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"O": 0,
|
| 3 |
+
"B-PER": 1,
|
| 4 |
+
"I-PER": 2,
|
| 5 |
+
"B-EMAIL": 3,
|
| 6 |
+
"I-EMAIL": 4,
|
| 7 |
+
"B-PHONE": 5,
|
| 8 |
+
"I-PHONE": 6,
|
| 9 |
+
"B-LOC": 7,
|
| 10 |
+
"I-LOC": 8,
|
| 11 |
+
"B-DATE": 9,
|
| 12 |
+
"I-DATE": 10,
|
| 13 |
+
"B-SSN": 11,
|
| 14 |
+
"I-SSN": 12,
|
| 15 |
+
"B-CC": 13,
|
| 16 |
+
"I-CC": 14,
|
| 17 |
+
"B-ID": 15,
|
| 18 |
+
"I-ID": 16,
|
| 19 |
+
"B-IP": 17,
|
| 20 |
+
"I-IP": 18,
|
| 21 |
+
"B-URL": 19,
|
| 22 |
+
"I-URL": 20,
|
| 23 |
+
"B-ORG": 21,
|
| 24 |
+
"I-ORG": 22,
|
| 25 |
+
"B-AGE": 23,
|
| 26 |
+
"I-AGE": 24,
|
| 27 |
+
"B-PASSPORT": 25,
|
| 28 |
+
"I-PASSPORT": 26,
|
| 29 |
+
"B-DRIVER": 27,
|
| 30 |
+
"I-DRIVER": 28,
|
| 31 |
+
"B-BANK": 29,
|
| 32 |
+
"I-BANK": 30,
|
| 33 |
+
"B-MEDICAL": 31,
|
| 34 |
+
"I-MEDICAL": 32,
|
| 35 |
+
"B-PLATE": 33,
|
| 36 |
+
"I-PLATE": 34
|
| 37 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c888c59de538cd8c98d8322ec7d96f2d704458c6bddea98b54ca5821dc97a98a
|
| 3 |
+
size 435697596
|
runs/Apr13_04-04-42_65661a2afab4/events.out.tfevents.1744517090.65661a2afab4.289.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6f5a84fefca8f5c987cf718eb443837f0734a96e0458f71de5cfa6935e6e0a5e
|
| 3 |
+
size 7644
|
runs/Apr13_04-08-50_65661a2afab4/events.out.tfevents.1744517333.65661a2afab4.289.1
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db35dccd8def46102f14aebc0d5ba2982043688fc34257fcb4fddcde6589ad00
|
| 3 |
+
size 11757
|
runs/Apr13_04-08-50_65661a2afab4/events.out.tfevents.1744517898.65661a2afab4.289.2
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9581be7062d4f300b6f0dc5b85d94901fd75c659c130a378a80e5c18f027a151
|
| 3 |
+
size 508
|
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
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "[PAD]",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"100": {
|
| 12 |
+
"content": "[UNK]",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"101": {
|
| 20 |
+
"content": "[CLS]",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"102": {
|
| 28 |
+
"content": "[SEP]",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"103": {
|
| 36 |
+
"content": "[MASK]",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
}
|
| 43 |
+
},
|
| 44 |
+
"clean_up_tokenization_spaces": false,
|
| 45 |
+
"cls_token": "[CLS]",
|
| 46 |
+
"do_lower_case": true,
|
| 47 |
+
"extra_special_tokens": {},
|
| 48 |
+
"mask_token": "[MASK]",
|
| 49 |
+
"model_max_length": 512,
|
| 50 |
+
"pad_token": "[PAD]",
|
| 51 |
+
"sep_token": "[SEP]",
|
| 52 |
+
"strip_accents": null,
|
| 53 |
+
"tokenize_chinese_chars": true,
|
| 54 |
+
"tokenizer_class": "BertTokenizer",
|
| 55 |
+
"unk_token": "[UNK]"
|
| 56 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:338f5091ae2ec8440197a0066e8b9ed3f5a0d013f232cc3d57eda3bf3cbf593f
|
| 3 |
+
size 5304
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|