jakelever commited on
Commit
6eaba08
·
verified ·
1 Parent(s): 393ac5c

Upload folder using huggingface_hub

Browse files
.ipynb_checkpoints/README-checkpoint.md ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ task: token-classification
3
+ tags:
4
+ - biomedical
5
+ - bionlp
6
+ license: mit
7
+ base_model: microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext
8
+ ---
9
+
10
+ # bioner_bc5cdr
11
+
12
+ This is a named entity recognition model fine-tuned from the [microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext](https://huggingface.co/microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext) model. It predicts spans with 2 possible labels. The labels are **Chemical and Disease**.
13
+
14
+ The code used for training this model can be found at https://github.com/Glasgow-AI4BioMed/bioner along with links to other biomedical NER models trained on well-known biomedical corpora. The source dataset information is below.
15
+
16
+ ## Example Usage
17
+
18
+ The code below will load up the model and apply it to the provided text. It uses a simple aggregation strategy to post-process the individual tokens into larger multi-token entities where needed.
19
+
20
+ ```python
21
+ from transformers import pipeline
22
+
23
+ # Load the model as part of an NER pipeline
24
+ ner_pipeline = pipeline("token-classification",
25
+ model="Glasgow-AI4BioMed/bioner_bc5cdr",
26
+ aggregation_strategy="max")
27
+
28
+ # Apply it to some text
29
+ ner_pipeline("EGFR T790M mutations have been known to affect treatment outcomes for NSCLC patients receiving erlotinib.")
30
+
31
+ # Output:
32
+ # [ {"entity_group": "Disease", "score": 0.99952, "word": "nsclc", "start": 51, "end": 56},
33
+ # {"entity_group": "Chemical", "score": 0.9995, "word": "erlotinib", "start": 76, "end": 85} ]
34
+ ```
35
+
36
+ ## Dataset Info
37
+
38
+ **Source:** The BC5CDR dataset was downloaded from: https://ftp.ncbi.nlm.nih.gov/pub/lu/BC5CDR/
39
+
40
+ The dataset should be cited with: Li, Jiao, et al. "BioCreative V CDR task corpus: a resource for chemical disease relation extraction." Database 2016 (2016). DOI: [10.1093/database/baw068](https://doi.org/10.1093/database/baw068)
41
+
42
+ **Preprocessing:** The training/validation/test split was maintained from the original dataset. Non-contiguous annotations were removed and no other changes were made. The preprocessing script for this dataset is [prepare_bc5cdr.py](https://github.com/Glasgow-AI4BioMed/bioner/blob/main/prepare_bc5cdr.py).
43
+
44
+ ## Performance
45
+
46
+ The span-level performance on the test split for the different labels are shown in the tables below. The full performance results are available in the model repo in Markdown format for viewing and JSON format for easier loading. These include the performance at token level (with individual B- and I- labels as the token classifier uses IOB2 token labelling).
47
+
48
+ | Label | Precision | Recall | F1-score | Support |
49
+ | --- | --- | --- | --- | --- |
50
+ | Chemical | 0.927 | 0.925 | 0.926 | 5370 |
51
+ | Disease | 0.815 | 0.862 | 0.838 | 4486 |
52
+ | macro avg | 0.871 | 0.893 | 0.882 | 9856 |
53
+ | weighted avg | 0.876 | 0.896 | 0.886 | 9856 |
54
+
55
+
56
+ ## Hyperparameters
57
+
58
+ Hyperparameter tuning was done with [optuna](https://optuna.org/) and the [hyperparameter_search](https://huggingface.co/docs/transformers/en/hpo_train) functionality. 100 trials were run. Early stopping was applied during training. The best performing model was selected using the macro F1 performance on the validation set. The selected hyperparameters are in the table below.
59
+
60
+ | Hyperparameter | Value |
61
+ |----------------|-------|
62
+ | epochs | 7.0 |
63
+ | learning_rate | 6.150691546013236e-05 |
64
+ | per_device_train_batch_size | 8 |
65
+ | weight_decay | 0.02919246813677108 |
66
+ | warmup_ratio | 0.014555287490025246 |
67
+
README.md ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ task: token-classification
3
+ tags:
4
+ - biomedical
5
+ - bionlp
6
+ license: mit
7
+ base_model: microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext
8
+ ---
9
+
10
+ # bioner_bc5cdr
11
+
12
+ This is a named entity recognition model fine-tuned from the [microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext](https://huggingface.co/microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext) model. It predicts spans with 2 possible labels. The labels are **Chemical and Disease**.
13
+
14
+ The code used for training this model can be found at https://github.com/Glasgow-AI4BioMed/bioner along with links to other biomedical NER models trained on well-known biomedical corpora. The source dataset information is below.
15
+
16
+ ## Example Usage
17
+
18
+ The code below will load up the model and apply it to the provided text. It uses a simple aggregation strategy to post-process the individual tokens into larger multi-token entities where needed.
19
+
20
+ ```python
21
+ from transformers import pipeline
22
+
23
+ # Load the model as part of an NER pipeline
24
+ ner_pipeline = pipeline("token-classification",
25
+ model="Glasgow-AI4BioMed/bioner_bc5cdr",
26
+ aggregation_strategy="max")
27
+
28
+ # Apply it to some text
29
+ ner_pipeline("EGFR T790M mutations have been known to affect treatment outcomes for NSCLC patients receiving erlotinib.")
30
+
31
+ # Output:
32
+ # [ {"entity_group": "Disease", "score": 0.99952, "word": "nsclc", "start": 51, "end": 56},
33
+ # {"entity_group": "Chemical", "score": 0.9995, "word": "erlotinib", "start": 76, "end": 85} ]
34
+ ```
35
+
36
+ ## Dataset Info
37
+
38
+ **Source:** The BC5CDR dataset was downloaded from: https://ftp.ncbi.nlm.nih.gov/pub/lu/BC5CDR/
39
+
40
+ The dataset should be cited with: Li, Jiao, et al. "BioCreative V CDR task corpus: a resource for chemical disease relation extraction." Database 2016 (2016). DOI: [10.1093/database/baw068](https://doi.org/10.1093/database/baw068)
41
+
42
+ **Preprocessing:** The training/validation/test split was maintained from the original dataset. Non-contiguous annotations were removed and no other changes were made. The preprocessing script for this dataset is [prepare_bc5cdr.py](https://github.com/Glasgow-AI4BioMed/bioner/blob/main/prepare_bc5cdr.py).
43
+
44
+ ## Performance
45
+
46
+ The span-level performance on the test split for the different labels are shown in the tables below. The full performance results are available in the model repo in Markdown format for viewing and JSON format for easier loading. These include the performance at token level (with individual B- and I- labels as the token classifier uses IOB2 token labelling).
47
+
48
+ | Label | Precision | Recall | F1-score | Support |
49
+ | --- | --- | --- | --- | --- |
50
+ | Chemical | 0.927 | 0.925 | 0.926 | 5370 |
51
+ | Disease | 0.815 | 0.862 | 0.838 | 4486 |
52
+ | macro avg | 0.871 | 0.893 | 0.882 | 9856 |
53
+ | weighted avg | 0.876 | 0.896 | 0.886 | 9856 |
54
+
55
+
56
+ ## Hyperparameters
57
+
58
+ Hyperparameter tuning was done with [optuna](https://optuna.org/) and the [hyperparameter_search](https://huggingface.co/docs/transformers/en/hpo_train) functionality. 100 trials were run. Early stopping was applied during training. The best performing model was selected using the macro F1 performance on the validation set. The selected hyperparameters are in the table below.
59
+
60
+ | Hyperparameter | Value |
61
+ |----------------|-------|
62
+ | epochs | 7.0 |
63
+ | learning_rate | 6.150691546013236e-05 |
64
+ | per_device_train_batch_size | 8 |
65
+ | weight_decay | 0.02919246813677108 |
66
+ | warmup_ratio | 0.014555287490025246 |
67
+
best_hyperparameters.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "epochs": 7.0,
3
+ "learning_rate": 6.150691546013236e-05,
4
+ "per_device_train_batch_size": 8,
5
+ "weight_decay": 0.02919246813677108,
6
+ "warmup_ratio": 0.014555287490025246
7
+ }
config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext",
3
+ "architectures": [
4
+ "BertForTokenClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 768,
11
+ "id2label": {
12
+ "0": "O",
13
+ "1": "B-Chemical",
14
+ "2": "I-Chemical",
15
+ "3": "B-Disease",
16
+ "4": "I-Disease"
17
+ },
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 3072,
20
+ "layer_norm_eps": 1e-12,
21
+ "max_position_embeddings": 512,
22
+ "model_type": "bert",
23
+ "num_attention_heads": 12,
24
+ "num_hidden_layers": 12,
25
+ "pad_token_id": 0,
26
+ "position_embedding_type": "absolute",
27
+ "torch_dtype": "float32",
28
+ "transformers_version": "4.48.1",
29
+ "type_vocab_size": 2,
30
+ "use_cache": true,
31
+ "vocab_size": 30522
32
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e607fbab85c80a31820bf05eb17e912613a571f2e388a3de15d1cdd19d45e460
3
+ size 435605316
performance_report.json ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "train": {
3
+ "token_level": {
4
+ "O": {
5
+ "precision": 0.9997374639012864,
6
+ "recall": 0.9994938037833481,
7
+ "f1-score": 0.9996156189940468,
8
+ "support": 106678.0
9
+ },
10
+ "B-Chemical": {
11
+ "precision": 0.9990338164251208,
12
+ "recall": 0.9971070395371263,
13
+ "f1-score": 0.9980694980694981,
14
+ "support": 5185.0
15
+ },
16
+ "I-Chemical": {
17
+ "precision": 0.9973860005808888,
18
+ "recall": 0.9995633823315383,
19
+ "f1-score": 0.9984735043977612,
20
+ "support": 6871.0
21
+ },
22
+ "B-Disease": {
23
+ "precision": 0.9969259872310239,
24
+ "recall": 0.9966903073286052,
25
+ "f1-score": 0.9968081333490957,
26
+ "support": 4230.0
27
+ },
28
+ "I-Disease": {
29
+ "precision": 0.9927427961579509,
30
+ "recall": 0.9974265494316963,
31
+ "f1-score": 0.995079161317929,
32
+ "support": 4663.0
33
+ },
34
+ "accuracy": 0.9992321374003933,
35
+ "macro avg": {
36
+ "precision": 0.9971652128592542,
37
+ "recall": 0.9980562164824628,
38
+ "f1-score": 0.9976091832256662,
39
+ "support": 127627.0
40
+ },
41
+ "weighted avg": {
42
+ "precision": 0.9992335423279456,
43
+ "recall": 0.9992321374003933,
44
+ "f1-score": 0.9992325239373056,
45
+ "support": 127627.0
46
+ }
47
+ },
48
+ "span_level": {
49
+ "Chemical": {
50
+ "precision": 0.9957289846631722,
51
+ "recall": 0.9893904320987654,
52
+ "f1-score": 0.9925495887760039,
53
+ "support": 5184
54
+ },
55
+ "Disease": {
56
+ "precision": 0.9825224374114313,
57
+ "recall": 0.9719626168224299,
58
+ "f1-score": 0.9772140004698144,
59
+ "support": 4280
60
+ },
61
+ "macro avg": {
62
+ "precision": 0.9891257110373017,
63
+ "recall": 0.9806765244605977,
64
+ "f1-score": 0.9848817946229091,
65
+ "support": 9464
66
+ },
67
+ "weighted avg": {
68
+ "precision": 0.9897564548409565,
69
+ "recall": 0.981508875739645,
70
+ "f1-score": 0.9856142212833485,
71
+ "support": 9464
72
+ }
73
+ }
74
+ },
75
+ "val": {
76
+ "token_level": {
77
+ "O": {
78
+ "precision": 0.9898514194746617,
79
+ "recall": 0.9864303386277361,
80
+ "f1-score": 0.9881379179870406,
81
+ "support": 105898.0
82
+ },
83
+ "B-Chemical": {
84
+ "precision": 0.9675103891197582,
85
+ "recall": 0.9622393387187677,
86
+ "f1-score": 0.9648676650654611,
87
+ "support": 5323.0
88
+ },
89
+ "I-Chemical": {
90
+ "precision": 0.9407634927599825,
91
+ "recall": 0.9688206055128784,
92
+ "f1-score": 0.9545859305431879,
93
+ "support": 6639.0
94
+ },
95
+ "B-Disease": {
96
+ "precision": 0.8871559633027523,
97
+ "recall": 0.8997441265410561,
98
+ "f1-score": 0.8934057050467722,
99
+ "support": 4299.0
100
+ },
101
+ "I-Disease": {
102
+ "precision": 0.847767948981691,
103
+ "recall": 0.8721693121693121,
104
+ "f1-score": 0.859795535155435,
105
+ "support": 4725.0
106
+ },
107
+ "accuracy": 0.9773021027079852,
108
+ "macro avg": {
109
+ "precision": 0.9266098427277691,
110
+ "recall": 0.9378807443139501,
111
+ "f1-score": 0.9321585507595793,
112
+ "support": 126884.0
113
+ },
114
+ "weighted avg": {
115
+ "precision": 0.9775752600361176,
116
+ "recall": 0.9773021027079852,
117
+ "f1-score": 0.9774171750781565,
118
+ "support": 126884.0
119
+ }
120
+ },
121
+ "span_level": {
122
+ "Chemical": {
123
+ "precision": 0.9490314086891104,
124
+ "recall": 0.9474277131055201,
125
+ "f1-score": 0.9482288828337875,
126
+ "support": 5326
127
+ },
128
+ "Disease": {
129
+ "precision": 0.8368648894964684,
130
+ "recall": 0.8435920992191088,
131
+ "f1-score": 0.84021502916619,
132
+ "support": 4354
133
+ },
134
+ "macro avg": {
135
+ "precision": 0.8929481490927894,
136
+ "recall": 0.8955099061623144,
137
+ "f1-score": 0.8942219559999887,
138
+ "support": 9680
139
+ },
140
+ "weighted avg": {
141
+ "precision": 0.8985796499530813,
142
+ "recall": 0.9007231404958678,
143
+ "f1-score": 0.8996449655952834,
144
+ "support": 9680
145
+ }
146
+ }
147
+ },
148
+ "test": {
149
+ "token_level": {
150
+ "O": {
151
+ "precision": 0.9904245019053287,
152
+ "recall": 0.9813587516172471,
153
+ "f1-score": 0.9858707857717575,
154
+ "support": 113619.0
155
+ },
156
+ "B-Chemical": {
157
+ "precision": 0.9497656982193065,
158
+ "recall": 0.9478114478114478,
159
+ "f1-score": 0.9487875667072372,
160
+ "support": 5346.0
161
+ },
162
+ "I-Chemical": {
163
+ "precision": 0.9000288933834152,
164
+ "recall": 0.9705561613958561,
165
+ "f1-score": 0.9339629712915074,
166
+ "support": 6419.0
167
+ },
168
+ "B-Disease": {
169
+ "precision": 0.8520797962648556,
170
+ "recall": 0.901032315978456,
171
+ "f1-score": 0.8758726003490401,
172
+ "support": 4456.0
173
+ },
174
+ "I-Disease": {
175
+ "precision": 0.8230053454761433,
176
+ "recall": 0.8735028367304055,
177
+ "f1-score": 0.8475025484199796,
178
+ "support": 4759.0
179
+ },
180
+ "accuracy": 0.9730384326778059,
181
+ "macro avg": {
182
+ "precision": 0.9030608470498098,
183
+ "recall": 0.9348523027066825,
184
+ "f1-score": 0.9183992945079045,
185
+ "support": 134599.0
186
+ },
187
+ "weighted avg": {
188
+ "precision": 0.9739992450357527,
189
+ "recall": 0.9730384326778059,
190
+ "f1-score": 0.9733886016094058,
191
+ "support": 134599.0
192
+ }
193
+ },
194
+ "span_level": {
195
+ "Chemical": {
196
+ "precision": 0.9266791044776119,
197
+ "recall": 0.924953445065177,
198
+ "f1-score": 0.9258154706430568,
199
+ "support": 5370
200
+ },
201
+ "Disease": {
202
+ "precision": 0.8145806995364517,
203
+ "recall": 0.8617922425323228,
204
+ "f1-score": 0.837521663778163,
205
+ "support": 4486
206
+ },
207
+ "macro avg": {
208
+ "precision": 0.8706299020070318,
209
+ "recall": 0.8933728437987498,
210
+ "f1-score": 0.8816685672106099,
211
+ "support": 9856
212
+ },
213
+ "weighted avg": {
214
+ "precision": 0.8756570423260246,
215
+ "recall": 0.8962053571428571,
216
+ "f1-score": 0.8856281717798351,
217
+ "support": 9856
218
+ }
219
+ }
220
+ }
221
+ }
performance_report.md ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Performance on Training Set
2
+
3
+ ## Span Level
4
+
5
+ | Label | Precision | Recall | F1-score | Support |
6
+ | --- | --- | --- | --- | --- |
7
+ | Chemical | 0.996 | 0.989 | 0.993 | 5184 |
8
+ | Disease | 0.983 | 0.972 | 0.977 | 4280 |
9
+ | macro avg | 0.989 | 0.981 | 0.985 | 9464 |
10
+ | weighted avg | 0.990 | 0.982 | 0.986 | 9464 |
11
+
12
+ ## Token Level
13
+
14
+ | Label | Precision | Recall | F1-score | Support |
15
+ | --- | --- | --- | --- | --- |
16
+ | O | 1.000 | 0.999 | 1.000 | 106678 |
17
+ | B-Chemical | 0.999 | 0.997 | 0.998 | 5185 |
18
+ | I-Chemical | 0.997 | 1.000 | 0.998 | 6871 |
19
+ | B-Disease | 0.997 | 0.997 | 0.997 | 4230 |
20
+ | I-Disease | 0.993 | 0.997 | 0.995 | 4663 |
21
+ | macro avg | 0.997 | 0.998 | 0.998 | 127627 |
22
+ | weighted avg | 0.999 | 0.999 | 0.999 | 127627 |
23
+
24
+
25
+ # Performance on Validation Set
26
+
27
+ ## Span Level
28
+
29
+ | Label | Precision | Recall | F1-score | Support |
30
+ | --- | --- | --- | --- | --- |
31
+ | Chemical | 0.949 | 0.947 | 0.948 | 5326 |
32
+ | Disease | 0.837 | 0.844 | 0.840 | 4354 |
33
+ | macro avg | 0.893 | 0.896 | 0.894 | 9680 |
34
+ | weighted avg | 0.899 | 0.901 | 0.900 | 9680 |
35
+
36
+ ## Token Level
37
+
38
+ | Label | Precision | Recall | F1-score | Support |
39
+ | --- | --- | --- | --- | --- |
40
+ | O | 0.990 | 0.986 | 0.988 | 105898 |
41
+ | B-Chemical | 0.968 | 0.962 | 0.965 | 5323 |
42
+ | I-Chemical | 0.941 | 0.969 | 0.955 | 6639 |
43
+ | B-Disease | 0.887 | 0.900 | 0.893 | 4299 |
44
+ | I-Disease | 0.848 | 0.872 | 0.860 | 4725 |
45
+ | macro avg | 0.927 | 0.938 | 0.932 | 126884 |
46
+ | weighted avg | 0.978 | 0.977 | 0.977 | 126884 |
47
+
48
+
49
+ # Performance on Testing Set
50
+
51
+ ## Span Level
52
+
53
+ | Label | Precision | Recall | F1-score | Support |
54
+ | --- | --- | --- | --- | --- |
55
+ | Chemical | 0.927 | 0.925 | 0.926 | 5370 |
56
+ | Disease | 0.815 | 0.862 | 0.838 | 4486 |
57
+ | macro avg | 0.871 | 0.893 | 0.882 | 9856 |
58
+ | weighted avg | 0.876 | 0.896 | 0.886 | 9856 |
59
+
60
+ ## Token Level
61
+
62
+ | Label | Precision | Recall | F1-score | Support |
63
+ | --- | --- | --- | --- | --- |
64
+ | O | 0.990 | 0.981 | 0.986 | 113619 |
65
+ | B-Chemical | 0.950 | 0.948 | 0.949 | 5346 |
66
+ | I-Chemical | 0.900 | 0.971 | 0.934 | 6419 |
67
+ | B-Disease | 0.852 | 0.901 | 0.876 | 4456 |
68
+ | I-Disease | 0.823 | 0.874 | 0.848 | 4759 |
69
+ | macro avg | 0.903 | 0.935 | 0.918 | 134599 |
70
+ | weighted avg | 0.974 | 0.973 | 0.973 | 134599 |
71
+
72
+
rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e570e25c91938d795ffd6c1b29eb4ade1e55ee5cd82acdd37edfc209de065f9
3
+ size 14244
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,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "1": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "4": {
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_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "model_max_length": 512,
51
+ "never_split": null,
52
+ "pad_token": "[PAD]",
53
+ "sep_token": "[SEP]",
54
+ "strip_accents": null,
55
+ "tokenize_chinese_chars": true,
56
+ "tokenizer_class": "BertTokenizer",
57
+ "unk_token": "[UNK]"
58
+ }
trainer_state.json ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": 0.9321585507595793,
3
+ "best_model_checkpoint": "tmp_ner_fantastic-bale-10_45/run-33/checkpoint-875",
4
+ "epoch": 7.0,
5
+ "eval_steps": 500,
6
+ "global_step": 875,
7
+ "is_hyper_param_search": true,
8
+ "is_local_process_zero": true,
9
+ "is_world_process_zero": true,
10
+ "log_history": [
11
+ {
12
+ "epoch": 1.0,
13
+ "eval_accuracy": 0.9730935342517575,
14
+ "eval_loss": 0.08587262034416199,
15
+ "eval_macro_f1": 0.9170047043200686,
16
+ "eval_macro_precision": 0.9278276425309375,
17
+ "eval_macro_recall": 0.90752738549263,
18
+ "eval_runtime": 5.7832,
19
+ "eval_samples_per_second": 172.914,
20
+ "eval_steps_per_second": 21.614,
21
+ "step": 125
22
+ },
23
+ {
24
+ "epoch": 2.0,
25
+ "eval_accuracy": 0.9750480754074587,
26
+ "eval_loss": 0.08141306042671204,
27
+ "eval_macro_f1": 0.9264657139223695,
28
+ "eval_macro_precision": 0.9157927892781152,
29
+ "eval_macro_recall": 0.9377952332788448,
30
+ "eval_runtime": 6.0324,
31
+ "eval_samples_per_second": 165.773,
32
+ "eval_steps_per_second": 20.722,
33
+ "step": 250
34
+ },
35
+ {
36
+ "epoch": 3.0,
37
+ "eval_accuracy": 0.9743781721887709,
38
+ "eval_loss": 0.08608711510896683,
39
+ "eval_macro_f1": 0.9247086477797719,
40
+ "eval_macro_precision": 0.9173611315562689,
41
+ "eval_macro_recall": 0.933305032585042,
42
+ "eval_runtime": 6.0132,
43
+ "eval_samples_per_second": 166.3,
44
+ "eval_steps_per_second": 20.787,
45
+ "step": 375
46
+ },
47
+ {
48
+ "epoch": 4.0,
49
+ "grad_norm": 0.6703500151634216,
50
+ "learning_rate": 5.4624258845588244e-05,
51
+ "loss": 0.1282,
52
+ "step": 500
53
+ },
54
+ {
55
+ "epoch": 4.0,
56
+ "eval_accuracy": 0.9770420226348476,
57
+ "eval_loss": 0.09856158494949341,
58
+ "eval_macro_f1": 0.9314150814858593,
59
+ "eval_macro_precision": 0.9211465798788551,
60
+ "eval_macro_recall": 0.9421883284262093,
61
+ "eval_runtime": 5.932,
62
+ "eval_samples_per_second": 168.577,
63
+ "eval_steps_per_second": 21.072,
64
+ "step": 500
65
+ },
66
+ {
67
+ "epoch": 5.0,
68
+ "eval_accuracy": 0.9750086693357712,
69
+ "eval_loss": 0.11021321266889572,
70
+ "eval_macro_f1": 0.9267488028708639,
71
+ "eval_macro_precision": 0.9153942226603791,
72
+ "eval_macro_recall": 0.9386080517042859,
73
+ "eval_runtime": 5.9689,
74
+ "eval_samples_per_second": 167.536,
75
+ "eval_steps_per_second": 20.942,
76
+ "step": 625
77
+ },
78
+ {
79
+ "epoch": 6.0,
80
+ "eval_accuracy": 0.9760253459853094,
81
+ "eval_loss": 0.11098870635032654,
82
+ "eval_macro_f1": 0.9287954097228024,
83
+ "eval_macro_precision": 0.9205523043756338,
84
+ "eval_macro_recall": 0.9374208211553338,
85
+ "eval_runtime": 5.9208,
86
+ "eval_samples_per_second": 168.896,
87
+ "eval_steps_per_second": 21.112,
88
+ "step": 750
89
+ },
90
+ {
91
+ "epoch": 7.0,
92
+ "eval_accuracy": 0.9773021027079852,
93
+ "eval_loss": 0.11490638554096222,
94
+ "eval_macro_f1": 0.9321585507595793,
95
+ "eval_macro_precision": 0.9266098427277691,
96
+ "eval_macro_recall": 0.9378807443139501,
97
+ "eval_runtime": 6.075,
98
+ "eval_samples_per_second": 164.61,
99
+ "eval_steps_per_second": 20.576,
100
+ "step": 875
101
+ }
102
+ ],
103
+ "logging_steps": 500,
104
+ "max_steps": 4000,
105
+ "num_input_tokens_seen": 0,
106
+ "num_train_epochs": 32,
107
+ "save_steps": 500,
108
+ "stateful_callbacks": {
109
+ "EarlyStoppingCallback": {
110
+ "args": {
111
+ "early_stopping_patience": 3,
112
+ "early_stopping_threshold": 0.001
113
+ },
114
+ "attributes": {
115
+ "early_stopping_patience_counter": 3
116
+ }
117
+ },
118
+ "TrainerControl": {
119
+ "args": {
120
+ "should_epoch_stop": false,
121
+ "should_evaluate": false,
122
+ "should_log": false,
123
+ "should_save": true,
124
+ "should_training_stop": true
125
+ },
126
+ "attributes": {}
127
+ }
128
+ },
129
+ "total_flos": 723885139142880.0,
130
+ "train_batch_size": 8,
131
+ "trial_name": null,
132
+ "trial_params": {
133
+ "learning_rate": 6.150691546013236e-05,
134
+ "per_device_train_batch_size": 8,
135
+ "warmup_ratio": 0.014555287490025246,
136
+ "weight_decay": 0.02919246813677108
137
+ }
138
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff