AmirlyPhd/final_V1-bert-text-classification-model
Browse files- README.md +94 -0
- config.json +45 -0
- model.safetensors +3 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +55 -0
- training_args.bin +3 -0
- vocab.txt +0 -0
README.md
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
base_model: bert-base-uncased
|
4 |
+
tags:
|
5 |
+
- generated_from_trainer
|
6 |
+
metrics:
|
7 |
+
- accuracy
|
8 |
+
- f1
|
9 |
+
- precision
|
10 |
+
- recall
|
11 |
+
model-index:
|
12 |
+
- name: final_V1-bert-text-classification-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 |
+
# final_V1-bert-text-classification-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.1649
|
24 |
+
- Accuracy: 0.9713
|
25 |
+
- F1: 0.8328
|
26 |
+
- Precision: 0.8290
|
27 |
+
- Recall: 0.8375
|
28 |
+
|
29 |
+
## Model description
|
30 |
+
|
31 |
+
More information needed
|
32 |
+
|
33 |
+
## Intended uses & limitations
|
34 |
+
|
35 |
+
More information needed
|
36 |
+
|
37 |
+
## Training and evaluation data
|
38 |
+
|
39 |
+
More information needed
|
40 |
+
|
41 |
+
## Training procedure
|
42 |
+
|
43 |
+
### Training hyperparameters
|
44 |
+
|
45 |
+
The following hyperparameters were used during training:
|
46 |
+
- learning_rate: 5e-05
|
47 |
+
- train_batch_size: 16
|
48 |
+
- eval_batch_size: 32
|
49 |
+
- seed: 42
|
50 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
51 |
+
- lr_scheduler_type: linear
|
52 |
+
- lr_scheduler_warmup_steps: 100
|
53 |
+
- num_epochs: 3
|
54 |
+
- mixed_precision_training: Native AMP
|
55 |
+
|
56 |
+
### Training results
|
57 |
+
|
58 |
+
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 | Precision | Recall |
|
59 |
+
|:-------------:|:-----:|:----:|:---------------:|:--------:|:------:|:---------:|:------:|
|
60 |
+
| 1.7173 | 0.11 | 50 | 1.7812 | 0.3445 | 0.1475 | 0.1755 | 0.1881 |
|
61 |
+
| 0.9537 | 0.22 | 100 | 0.9779 | 0.7416 | 0.4399 | 0.4301 | 0.4701 |
|
62 |
+
| 0.373 | 0.33 | 150 | 0.6741 | 0.8321 | 0.6187 | 0.6018 | 0.6423 |
|
63 |
+
| 0.2625 | 0.44 | 200 | 0.3897 | 0.9070 | 0.6684 | 0.6503 | 0.6892 |
|
64 |
+
| 0.2216 | 0.55 | 250 | 0.3971 | 0.9089 | 0.6670 | 0.6465 | 0.6920 |
|
65 |
+
| 0.1583 | 0.66 | 300 | 0.3601 | 0.9029 | 0.6816 | 0.7957 | 0.6757 |
|
66 |
+
| 0.1661 | 0.76 | 350 | 0.2266 | 0.9180 | 0.6950 | 0.7317 | 0.7019 |
|
67 |
+
| 0.112 | 0.87 | 400 | 0.2525 | 0.9494 | 0.8020 | 0.7955 | 0.8132 |
|
68 |
+
| 0.0857 | 0.98 | 450 | 0.2701 | 0.9459 | 0.8124 | 0.8060 | 0.8232 |
|
69 |
+
| 0.1223 | 1.09 | 500 | 0.1781 | 0.9631 | 0.8281 | 0.8251 | 0.8319 |
|
70 |
+
| 0.0641 | 1.2 | 550 | 0.2162 | 0.9552 | 0.8236 | 0.8229 | 0.8258 |
|
71 |
+
| 0.0907 | 1.31 | 600 | 0.1486 | 0.9705 | 0.8351 | 0.8357 | 0.8346 |
|
72 |
+
| 0.0738 | 1.42 | 650 | 0.1380 | 0.9696 | 0.8300 | 0.8276 | 0.8331 |
|
73 |
+
| 0.0946 | 1.53 | 700 | 0.1577 | 0.9705 | 0.8357 | 0.8370 | 0.8345 |
|
74 |
+
| 0.0476 | 1.64 | 750 | 0.1497 | 0.9707 | 0.8349 | 0.8337 | 0.8363 |
|
75 |
+
| 0.0873 | 1.75 | 800 | 0.1722 | 0.9655 | 0.8318 | 0.8288 | 0.8353 |
|
76 |
+
| 0.0487 | 1.86 | 850 | 0.1782 | 0.9647 | 0.8312 | 0.8283 | 0.8345 |
|
77 |
+
| 0.0548 | 1.97 | 900 | 0.1610 | 0.9666 | 0.8336 | 0.8329 | 0.8346 |
|
78 |
+
| 0.0492 | 2.07 | 950 | 0.1423 | 0.9688 | 0.8338 | 0.8287 | 0.8393 |
|
79 |
+
| 0.0279 | 2.18 | 1000 | 0.1707 | 0.9669 | 0.8325 | 0.8287 | 0.8371 |
|
80 |
+
| 0.0401 | 2.29 | 1050 | 0.1583 | 0.9688 | 0.8337 | 0.8300 | 0.8382 |
|
81 |
+
| 0.0313 | 2.4 | 1100 | 0.1799 | 0.9647 | 0.8306 | 0.8274 | 0.8348 |
|
82 |
+
| 0.025 | 2.51 | 1150 | 0.1661 | 0.9669 | 0.8320 | 0.8311 | 0.8335 |
|
83 |
+
| 0.0043 | 2.62 | 1200 | 0.1933 | 0.9647 | 0.8305 | 0.8280 | 0.8339 |
|
84 |
+
| 0.0115 | 2.73 | 1250 | 0.1570 | 0.9696 | 0.8328 | 0.8308 | 0.8352 |
|
85 |
+
| 0.0198 | 2.84 | 1300 | 0.1538 | 0.9702 | 0.8340 | 0.8328 | 0.8355 |
|
86 |
+
| 0.0085 | 2.95 | 1350 | 0.1591 | 0.9694 | 0.8337 | 0.8327 | 0.8351 |
|
87 |
+
|
88 |
+
|
89 |
+
### Framework versions
|
90 |
+
|
91 |
+
- Transformers 4.39.3
|
92 |
+
- Pytorch 2.1.2
|
93 |
+
- Datasets 2.18.0
|
94 |
+
- Tokenizers 0.15.2
|
config.json
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "bert-base-uncased",
|
3 |
+
"architectures": [
|
4 |
+
"BertForSequenceClassification"
|
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": "LABEL_0",
|
14 |
+
"1": "LABEL_1",
|
15 |
+
"2": "LABEL_2",
|
16 |
+
"3": "LABEL_3",
|
17 |
+
"4": "LABEL_4",
|
18 |
+
"5": "LABEL_5",
|
19 |
+
"6": "LABEL_6"
|
20 |
+
},
|
21 |
+
"initializer_range": 0.02,
|
22 |
+
"intermediate_size": 3072,
|
23 |
+
"label2id": {
|
24 |
+
"LABEL_0": 0,
|
25 |
+
"LABEL_1": 1,
|
26 |
+
"LABEL_2": 2,
|
27 |
+
"LABEL_3": 3,
|
28 |
+
"LABEL_4": 4,
|
29 |
+
"LABEL_5": 5,
|
30 |
+
"LABEL_6": 6
|
31 |
+
},
|
32 |
+
"layer_norm_eps": 1e-12,
|
33 |
+
"max_position_embeddings": 512,
|
34 |
+
"model_type": "bert",
|
35 |
+
"num_attention_heads": 12,
|
36 |
+
"num_hidden_layers": 12,
|
37 |
+
"pad_token_id": 0,
|
38 |
+
"position_embedding_type": "absolute",
|
39 |
+
"problem_type": "single_label_classification",
|
40 |
+
"torch_dtype": "float32",
|
41 |
+
"transformers_version": "4.39.3",
|
42 |
+
"type_vocab_size": 2,
|
43 |
+
"use_cache": true,
|
44 |
+
"vocab_size": 30522
|
45 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e72649d61ebfbcf7b1d384e6c65d2183ea949b9985b36262cc3a5df255719db4
|
3 |
+
size 437974028
|
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,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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": true,
|
45 |
+
"cls_token": "[CLS]",
|
46 |
+
"do_lower_case": true,
|
47 |
+
"mask_token": "[MASK]",
|
48 |
+
"model_max_length": 512,
|
49 |
+
"pad_token": "[PAD]",
|
50 |
+
"sep_token": "[SEP]",
|
51 |
+
"strip_accents": null,
|
52 |
+
"tokenize_chinese_chars": true,
|
53 |
+
"tokenizer_class": "BertTokenizer",
|
54 |
+
"unk_token": "[UNK]"
|
55 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e78bf5e7f8b1ba1d7c3e4e02614d71e07f8682ca40db55eb24ad560f0a6c9d73
|
3 |
+
size 4920
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|