eitang commited on
Commit
5859cf7
·
verified ·
1 Parent(s): 6bb931e

Initial upload of st2 BERT-large-NER BIO span extractor

Browse files
classification_report.txt ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ precision recall f1-score support
2
+
3
+ O 0.99 0.95 0.97 75421
4
+ B-SUBJ 0.45 0.42 0.43 445
5
+ I-SUBJ 0.46 0.67 0.55 2120
6
+ B-OBJ 0.45 0.45 0.45 461
7
+ I-OBJ 0.45 0.81 0.58 2321
8
+
9
+ accuracy 0.93 80768
10
+ macro avg 0.56 0.66 0.60 80768
11
+ weighted avg 0.95 0.93 0.94 80768
12
+
13
+ # Notes
14
+ # Best dev macro F1: 0.7000 (epoch 6)
15
+ # Model: dslim/bert-large-NER, 10 epochs, BIO token classification
16
+ # Train/Dev/Test rows: 6791 / 627 / 631
17
+ # Label scheme: O, B-SUBJ, I-SUBJ, B-OBJ, I-OBJ
18
+ # Known span-level pattern: I-class F1 > B-class F1, so spans may be off-by-one
19
+ # at boundaries. Resolver should expand spans to token boundaries when matching
20
+ # to coref clusters by char-offset overlap.
config.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/content/drive/MyDrive/causalsense/checkpoints/st2_bert_large_ner",
3
+ "architectures": [
4
+ "BertForTokenClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "directionality": "bidi",
9
+ "eos_token_ids": null,
10
+ "hidden_act": "gelu",
11
+ "hidden_dropout_prob": 0.1,
12
+ "hidden_size": 1024,
13
+ "id2label": {
14
+ "0": "O",
15
+ "1": "B-SUBJ",
16
+ "2": "I-SUBJ",
17
+ "3": "B-OBJ",
18
+ "4": "I-OBJ"
19
+ },
20
+ "initializer_range": 0.02,
21
+ "intermediate_size": 4096,
22
+ "label2id": {
23
+ "B-OBJ": 3,
24
+ "B-SUBJ": 1,
25
+ "I-OBJ": 4,
26
+ "I-SUBJ": 2,
27
+ "O": 0
28
+ },
29
+ "layer_norm_eps": 1e-12,
30
+ "max_position_embeddings": 512,
31
+ "model_type": "bert",
32
+ "num_attention_heads": 16,
33
+ "num_hidden_layers": 24,
34
+ "output_past": true,
35
+ "pad_token_id": 0,
36
+ "pooler_fc_size": 768,
37
+ "pooler_num_attention_heads": 12,
38
+ "pooler_num_fc_layers": 3,
39
+ "pooler_size_per_head": 128,
40
+ "pooler_type": "first_token_transform",
41
+ "position_embedding_type": "absolute",
42
+ "torch_dtype": "float32",
43
+ "transformers_version": "4.44.2",
44
+ "type_vocab_size": 2,
45
+ "use_cache": true,
46
+ "vocab_size": 28996
47
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc2fc78e38506ac197b39d6e506ad011d062b4ffe8dc76b7791b1c1b03e218ba
3
+ size 1330185964
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
+ "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_basic_tokenize": true,
47
+ "do_lower_case": false,
48
+ "mask_token": "[MASK]",
49
+ "max_len": 512,
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
+ }
training_log.txt ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ st2 — EE.py (BIO token classification for subject/object spans)
2
+ Model: dslim/bert-large-NER
3
+ Data: combined.csv (train) + News_data/dev.csv + Test_dataset/test.csv
4
+ Train/Dev/Test: 6791 / 627 / 631
5
+
6
+ ================================================================
7
+ Epoch 1, Loss: 0.15692909639547853
8
+ precision recall f1-score support
9
+ O 0.95 0.97 0.96 71126
10
+ B-SUBJ 0.50 0.22 0.31 481
11
+ I-SUBJ 0.70 0.54 0.61 4183
12
+ B-OBJ 0.46 0.26 0.33 480
13
+ I-OBJ 0.57 0.59 0.58 3986
14
+ accuracy 0.92 80256
15
+ macro avg 0.64 0.52 0.56 80256
16
+ weighted avg 0.91 0.92 0.92 80256
17
+ dev macro F1 = 0.5571 *** saved ***
18
+
19
+ Epoch 2, Loss: 0.076583794336766
20
+ precision recall f1-score support
21
+ O 0.94 0.98 0.96 71126
22
+ B-SUBJ 0.66 0.40 0.50 481
23
+ I-SUBJ 0.75 0.42 0.54 4183
24
+ B-OBJ 0.56 0.40 0.47 480
25
+ I-OBJ 0.62 0.54 0.58 3986
26
+ accuracy 0.92 80256
27
+ macro avg 0.71 0.55 0.61 80256
28
+ weighted avg 0.91 0.92 0.91 80256
29
+ dev macro F1 = 0.6084 *** saved ***
30
+
31
+ Epoch 3, Loss: 0.06505040774450582
32
+ precision recall f1-score support
33
+ O 0.99 0.95 0.97 71126
34
+ B-SUBJ 0.54 0.57 0.56 481
35
+ I-SUBJ 0.63 0.74 0.68 4183
36
+ B-OBJ 0.52 0.59 0.55 480
37
+ I-OBJ 0.53 0.81 0.64 3986
38
+ accuracy 0.92 80256
39
+ macro avg 0.64 0.73 0.68 80256
40
+ weighted avg 0.94 0.92 0.93 80256
41
+ dev macro F1 = 0.6805 *** saved ***
42
+
43
+ Epoch 4, Loss: 0.05100112235557069
44
+ precision recall f1-score support
45
+ O 0.99 0.95 0.97 71126
46
+ B-SUBJ 0.60 0.55 0.57 481
47
+ I-SUBJ 0.68 0.67 0.67 4183
48
+ B-OBJ 0.57 0.53 0.55 480
49
+ I-OBJ 0.50 0.88 0.64 3986
50
+ accuracy 0.92 80256
51
+ macro avg 0.67 0.72 0.68 80256
52
+ weighted avg 0.94 0.92 0.93 80256
53
+ dev macro F1 = 0.6806 *** saved ***
54
+
55
+ Epoch 5, Loss: 0.04952669816461446
56
+ precision recall f1-score support
57
+ O 0.98 0.96 0.97 71126
58
+ B-SUBJ 0.58 0.57 0.57 481
59
+ I-SUBJ 0.71 0.58 0.64 4183
60
+ B-OBJ 0.57 0.54 0.56 480
61
+ I-OBJ 0.54 0.87 0.66 3986
62
+ accuracy 0.93 80256
63
+ macro avg 0.68 0.70 0.68 80256
64
+ weighted avg 0.94 0.93 0.93 80256
65
+ dev macro F1 = 0.6800
66
+
67
+ Epoch 6, Loss: 0.03766294808161226
68
+ precision recall f1-score support
69
+ O 0.98 0.96 0.97 71126
70
+ B-SUBJ 0.55 0.64 0.59 481
71
+ I-SUBJ 0.64 0.79 0.71 4183
72
+ B-OBJ 0.55 0.60 0.58 480
73
+ I-OBJ 0.61 0.71 0.66 3986
74
+ accuracy 0.93 80256
75
+ macro avg 0.67 0.74 0.70 80256
76
+ weighted avg 0.94 0.93 0.94 80256
77
+ dev macro F1 = 0.7000 *** saved (BEST) ***
78
+
79
+ Epoch 7, Loss: 0.034522786220631506
80
+ precision recall f1-score support
81
+ O 0.97 0.97 0.97 71126
82
+ B-SUBJ 0.60 0.54 0.57 481
83
+ I-SUBJ 0.63 0.70 0.66 4183
84
+ B-OBJ 0.59 0.55 0.57 480
85
+ I-OBJ 0.67 0.57 0.62 3986
86
+ accuracy 0.93 80256
87
+ macro avg 0.69 0.67 0.68 80256
88
+ weighted avg 0.93 0.93 0.93 80256
89
+ dev macro F1 = 0.6774
90
+
91
+ Epoch 8, Loss: 0.03382389528087943
92
+ precision recall f1-score support
93
+ O 0.98 0.95 0.97 71126
94
+ B-SUBJ 0.57 0.57 0.57 481
95
+ I-SUBJ 0.63 0.73 0.67 4183
96
+ B-OBJ 0.56 0.57 0.57 480
97
+ I-OBJ 0.54 0.79 0.64 3986
98
+ accuracy 0.92 80256
99
+ macro avg 0.66 0.72 0.68 80256
100
+ weighted avg 0.94 0.92 0.93 80256
101
+ dev macro F1 = 0.6845
102
+
103
+ Epoch 9, Loss: 0.03163016356212799
104
+ precision recall f1-score support
105
+ O 0.96 0.97 0.97 71126
106
+ B-SUBJ 0.54 0.61 0.58 481
107
+ I-SUBJ 0.76 0.48 0.59 4183
108
+ B-OBJ 0.55 0.61 0.58 480
109
+ I-OBJ 0.58 0.65 0.61 3986
110
+ accuracy 0.93 80256
111
+ macro avg 0.68 0.67 0.66 80256
112
+ weighted avg 0.93 0.93 0.92 80256
113
+ dev macro F1 = 0.6644
114
+
115
+ Epoch 10, Loss: 0.02971732596274438
116
+ precision recall f1-score support
117
+ O 0.98 0.95 0.97 71126
118
+ B-SUBJ 0.59 0.58 0.59 481
119
+ I-SUBJ 0.66 0.67 0.67 4183
120
+ B-OBJ 0.56 0.56 0.56 480
121
+ I-OBJ 0.53 0.85 0.65 3986
122
+ accuracy 0.92 80256
123
+ macro avg 0.67 0.72 0.69 80256
124
+ weighted avg 0.94 0.92 0.93 80256
125
+ dev macro F1 = 0.6859
126
+
127
+ ================================================================
128
+ Test Set (best model from epoch 6):
129
+ precision recall f1-score support
130
+ O 0.99 0.95 0.97 75421
131
+ B-SUBJ 0.45 0.42 0.43 445
132
+ I-SUBJ 0.46 0.67 0.55 2120
133
+ B-OBJ 0.45 0.45 0.45 461
134
+ I-OBJ 0.45 0.81 0.58 2321
135
+ accuracy 0.93 80768
136
+ macro avg 0.56 0.66 0.60 80768
137
+ weighted avg 0.95 0.93 0.94 80768
vocab.txt ADDED
The diff for this file is too large to render. See raw diff