lorenpe2 commited on
Commit
822e1b3
·
1 Parent(s): e8d577f

FEAT: new models, reload model each time when something change (not ideal but it is better than st.cache_resource)

Browse files
app.py CHANGED
@@ -8,19 +8,29 @@ import pandas
8
  import streamlit as st
9
  import matplotlib.pyplot as plt
10
 
 
11
  from inference_tokenizer import NextSentencePredictionTokenizer
 
 
12
 
 
 
 
 
 
 
 
 
 
13
 
14
- @st.cache_resource
15
- def get_model(model_path):
16
- from transformers import BertForNextSentencePrediction
17
- _model = BertForNextSentencePrediction.from_pretrained(model_path)
18
  _model.eval()
19
  return _model
20
 
21
 
22
- @st.cache_resource
23
  def get_tokenizer(tokenizer_path):
 
24
  from transformers import BertTokenizer
25
  tokenizer = BertTokenizer.from_pretrained(tokenizer_path)
26
  if os.path.isfile(os.path.join(tokenizer_path, "meta-info.json")):
@@ -33,8 +43,8 @@ def get_tokenizer(tokenizer_path):
33
 
34
  if special_token != " ":
35
  tokenizer.add_special_tokens({"additional_special_tokens": [special_token]})
36
- print(special_token)
37
- print(tokenizer_args)
38
  _inference_tokenizer = NextSentencePredictionTokenizer(tokenizer, **tokenizer_args)
39
  return _inference_tokenizer
40
 
@@ -47,11 +57,12 @@ for model_path in models_path:
47
  model_data["path"] = model_path.replace("info.json", "")
48
  models[model_data["model"]] = model_data
49
 
 
50
  model_name = st.selectbox('Which model do you want to use?',
51
- (x for x in sorted(models.keys())))
 
52
 
53
  model_path = models[model_name]["path"]
54
-
55
  model = get_model(model_path)
56
  inference_tokenizer = get_tokenizer(model_path)
57
 
 
8
  import streamlit as st
9
  import matplotlib.pyplot as plt
10
 
11
+
12
  from inference_tokenizer import NextSentencePredictionTokenizer
13
+ from models import get_class
14
+ from models import OwnBertForNextSentencePrediction
15
 
16
+ def get_model(_model_path):
17
+ print(f"Getting model at {_model_path}")
18
+ if os.path.isfile(os.path.join(_model_path, "meta-info.json")):
19
+ with open(os.path.join(_model_path, "meta-info.json"), "r") as f:
20
+ meta_info = json.load(f)
21
+ _model_package = meta_info["kwargs"].get("model_package", "transformers")
22
+ _model_class = meta_info["kwargs"].get("model_class", "BertForNextSentencePrediction")
23
+ else:
24
+ raise FileNotFoundError("Tokenizer is provided without meta-info.json. Cannot interfere proper configuration!")
25
 
26
+ model_class = get_class(_model_package, _model_class)
27
+ _model = model_class.from_pretrained(_model_path)
 
 
28
  _model.eval()
29
  return _model
30
 
31
 
 
32
  def get_tokenizer(tokenizer_path):
33
+ print(f"Getting tokenizer at {tokenizer_path}")
34
  from transformers import BertTokenizer
35
  tokenizer = BertTokenizer.from_pretrained(tokenizer_path)
36
  if os.path.isfile(os.path.join(tokenizer_path, "meta-info.json")):
 
43
 
44
  if special_token != " ":
45
  tokenizer.add_special_tokens({"additional_special_tokens": [special_token]})
46
+ # print(special_token)
47
+ # print(tokenizer_args)
48
  _inference_tokenizer = NextSentencePredictionTokenizer(tokenizer, **tokenizer_args)
49
  return _inference_tokenizer
50
 
 
57
  model_data["path"] = model_path.replace("info.json", "")
58
  models[model_data["model"]] = model_data
59
 
60
+
61
  model_name = st.selectbox('Which model do you want to use?',
62
+ (x for x in sorted(models.keys())),
63
+ index=0)
64
 
65
  model_path = models[model_name]["path"]
 
66
  model = get_model(model_path)
67
  inference_tokenizer = get_tokenizer(model_path)
68
 
inference_tokenizer.py CHANGED
@@ -13,10 +13,9 @@ class NextSentencePredictionTokenizer:
13
  self.tokenizer_args["max_length"] = self.max_length_ctx + self.max_length_res
14
 
15
  # cleaning
16
- del self.tokenizer_args["special_token"]
17
- del self.tokenizer_args["naive_approach"]
18
- del self.tokenizer_args["max_length_ctx"]
19
- del self.tokenizer_args["max_length_res"]
20
 
21
  def get_item(self, context: List[str], actual_sentence: str):
22
  context_str = f" {self.special_token} ".join(context) if self.special_token != " " else " ".join(context)
 
13
  self.tokenizer_args["max_length"] = self.max_length_ctx + self.max_length_res
14
 
15
  # cleaning
16
+ for key_to_delete in ["special_token", "naive_approach", "max_length_ctx", "max_length_res", "approach"]:
17
+ if key_to_delete in self.tokenizer_args:
18
+ del self.tokenizer_args[key_to_delete]
 
19
 
20
  def get_item(self, context: List[str], actual_sentence: str):
21
  context_str = f" {self.special_token} ".join(context) if self.special_token != " " else " ".join(context)
model/d1dd8365cbf16ff423f537e2291c61a91c717ed1/config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "bert-base-uncased",
3
+ "architectures": [
4
+ "OwnBertForNextSentencePrediction"
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
+ "initializer_range": 0.02,
13
+ "intermediate_size": 3072,
14
+ "layer_norm_eps": 1e-12,
15
+ "max_position_embeddings": 512,
16
+ "model_type": "bert",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 12,
19
+ "pad_token_id": 0,
20
+ "position_embedding_type": "absolute",
21
+ "torch_dtype": "float32",
22
+ "transformers_version": "4.17.0",
23
+ "type_vocab_size": 2,
24
+ "use_cache": true,
25
+ "vocab_size": 30522
26
+ }
model/d1dd8365cbf16ff423f537e2291c61a91c717ed1/info.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "model": "BERT-NSP-v4",
3
+ "description": "Model trained on DailyDialogue and CommonDialogues. Using [unused1] token to divide sentences in context. Improved training arguments (warmup, smaller learning rate). Using frozen test set to better compare models and therefore trained longer time (about 60 epochs) More info can be found at https://wandb.ai/alquist/next-sentence-prediction/runs/vzpwetvm/overview?workspace=user-petr-lorenc"
4
+ }
model/d1dd8365cbf16ff423f537e2291c61a91c717ed1/meta-info.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"args": [], "kwargs": {"model_package": "models", "model_class": "OwnBertForNextSentencePrediction","data_root": "/home/lorenpe2/project/data", "data_sources": [["COMMON_DIALOGUES", "common_dialogues/train.json", "common_dialogues/valid_frozen.json", "common_dialogues/test_frozen.json"], ["DAILY_DIALOGUES", "daily_dialogues/dialogues_text.train.txt", "daily_dialogues/dev_frozen.json", "daily_dialogues/test_frozen.json"]], "pretrained_model": "bert-base-uncased", "tokenizer": "bert-base-uncased", "approach": "IGNORE_DUPLICITIES", "special_token": "[unused1]", "learning_rate": 5e-07, "warmup_ratio": 0.1, "freeze_prefinetuning": true, "prefinenuting_epoch": 10, "finetuning_epochs": 75}, "tokenizer_args": {"padding": "max_length", "max_length_ctx": 256, "max_length_res": 40, "truncation": "only_first", "return_tensors": "np", "is_split_into_words": true, "approach": "IGNORE_DUPLICITIES", "special_token": "[unused1]"}}
model/d1dd8365cbf16ff423f537e2291c61a91c717ed1/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:486f1fc1c4302a5332800463f331651de7735bff5034d1e4c75e97f35412d62e
3
+ size 69074944
model/d1dd8365cbf16ff423f537e2291c61a91c717ed1/pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6cac4be9fdac90195f60a8ef106ab8f9e382758c3f576a35b52eaea575d4a19a
3
+ size 438871109
model/d1dd8365cbf16ff423f537e2291c61a91c717ed1/special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "additional_special_tokens": ["[unused1]"]}
model/d1dd8365cbf16ff423f537e2291c61a91c717ed1/tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"do_lower_case": true, "do_basic_tokenize": true, "never_split": null, "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "tokenize_chinese_chars": true, "strip_accents": null, "model_max_length": 512, "special_tokens_map_file": null, "name_or_path": "bert-base-uncased", "tokenizer_class": "BertTokenizer"}
model/d1dd8365cbf16ff423f537e2291c61a91c717ed1/trainer_state.json ADDED
@@ -0,0 +1,1060 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": 0.3728518784046173,
3
+ "best_model_checkpoint": "/home/lorenpe2/scratch/dialogue-quality/d1dd8365cbf16ff423f537e2291c61a91c717ed1/checkpoint-10494",
4
+ "epoch": 65.99478623566215,
5
+ "global_step": 10494,
6
+ "is_hyper_param_search": false,
7
+ "is_local_process_zero": true,
8
+ "is_world_process_zero": true,
9
+ "log_history": [
10
+ {
11
+ "epoch": 0.99,
12
+ "eval_accuracy": 0.7063609467455622,
13
+ "eval_f1": 0.6026026026026026,
14
+ "eval_loss": 0.6779443621635437,
15
+ "eval_precision_following": 0.6355685131195336,
16
+ "eval_precision_not_following": 0.9318885448916409,
17
+ "eval_recall_following": 0.9674556213017751,
18
+ "eval_recall_not_following": 0.4452662721893491,
19
+ "eval_runtime": 6.4103,
20
+ "eval_samples_per_second": 1265.468,
21
+ "eval_steps_per_second": 4.992,
22
+ "step": 159
23
+ },
24
+ {
25
+ "epoch": 1.99,
26
+ "eval_accuracy": 0.76232741617357,
27
+ "eval_f1": 0.707168894289186,
28
+ "eval_loss": 0.6727659702301025,
29
+ "eval_precision_following": 0.6905444126074498,
30
+ "eval_precision_not_following": 0.9208860759493671,
31
+ "eval_recall_following": 0.9506903353057199,
32
+ "eval_recall_not_following": 0.5739644970414202,
33
+ "eval_runtime": 6.6319,
34
+ "eval_samples_per_second": 1223.188,
35
+ "eval_steps_per_second": 4.825,
36
+ "step": 318
37
+ },
38
+ {
39
+ "epoch": 2.99,
40
+ "eval_accuracy": 0.8150887573964497,
41
+ "eval_f1": 0.7912607848594491,
42
+ "eval_loss": 0.6655098795890808,
43
+ "eval_precision_following": 0.7565234845443597,
44
+ "eval_precision_not_following": 0.9083067092651758,
45
+ "eval_recall_following": 0.9292406311637081,
46
+ "eval_recall_not_following": 0.7009368836291914,
47
+ "eval_runtime": 6.7829,
48
+ "eval_samples_per_second": 1195.945,
49
+ "eval_steps_per_second": 4.718,
50
+ "step": 477
51
+ },
52
+ {
53
+ "epoch": 3.14,
54
+ "learning_rate": 2.0955574182732605e-07,
55
+ "loss": 0.674,
56
+ "step": 500
57
+ },
58
+ {
59
+ "epoch": 3.99,
60
+ "eval_accuracy": 0.8354289940828402,
61
+ "eval_f1": 0.8217861433720465,
62
+ "eval_loss": 0.6588814854621887,
63
+ "eval_precision_following": 0.790891597177678,
64
+ "eval_precision_not_following": 0.8960698689956332,
65
+ "eval_recall_following": 0.9119822485207101,
66
+ "eval_recall_not_following": 0.7588757396449705,
67
+ "eval_runtime": 6.5136,
68
+ "eval_samples_per_second": 1245.393,
69
+ "eval_steps_per_second": 4.913,
70
+ "step": 636
71
+ },
72
+ {
73
+ "epoch": 4.99,
74
+ "eval_accuracy": 0.8497287968441815,
75
+ "eval_f1": 0.8397949796293863,
76
+ "eval_loss": 0.6521937251091003,
77
+ "eval_precision_following": 0.8111427944724721,
78
+ "eval_precision_not_following": 0.8992400788066423,
79
+ "eval_recall_following": 0.9117357001972387,
80
+ "eval_recall_not_following": 0.7877218934911243,
81
+ "eval_runtime": 6.6185,
82
+ "eval_samples_per_second": 1225.651,
83
+ "eval_steps_per_second": 4.835,
84
+ "step": 795
85
+ },
86
+ {
87
+ "epoch": 5.99,
88
+ "eval_accuracy": 0.8574950690335306,
89
+ "eval_f1": 0.8495183545951575,
90
+ "eval_loss": 0.6446988582611084,
91
+ "eval_precision_following": 0.8232278198840838,
92
+ "eval_precision_not_following": 0.8998896856039713,
93
+ "eval_recall_following": 0.9105029585798816,
94
+ "eval_recall_not_following": 0.8044871794871795,
95
+ "eval_runtime": 7.6742,
96
+ "eval_samples_per_second": 1057.054,
97
+ "eval_steps_per_second": 4.17,
98
+ "step": 954
99
+ },
100
+ {
101
+ "epoch": 6.29,
102
+ "learning_rate": 4.191114836546521e-07,
103
+ "loss": 0.6536,
104
+ "step": 1000
105
+ },
106
+ {
107
+ "epoch": 6.99,
108
+ "eval_accuracy": 0.8603303747534516,
109
+ "eval_f1": 0.8529907875956921,
110
+ "eval_loss": 0.6363867521286011,
111
+ "eval_precision_following": 0.8276171262048868,
112
+ "eval_precision_not_following": 0.9003012873185429,
113
+ "eval_recall_following": 0.9102564102564102,
114
+ "eval_recall_not_following": 0.810404339250493,
115
+ "eval_runtime": 7.6857,
116
+ "eval_samples_per_second": 1055.464,
117
+ "eval_steps_per_second": 4.164,
118
+ "step": 1113
119
+ },
120
+ {
121
+ "epoch": 7.99,
122
+ "eval_accuracy": 0.8664940828402367,
123
+ "eval_f1": 0.860456126787785,
124
+ "eval_loss": 0.6268088817596436,
125
+ "eval_precision_following": 0.8373042886317222,
126
+ "eval_precision_not_following": 0.9012145748987854,
127
+ "eval_recall_following": 0.9097633136094675,
128
+ "eval_recall_not_following": 0.8232248520710059,
129
+ "eval_runtime": 7.454,
130
+ "eval_samples_per_second": 1088.275,
131
+ "eval_steps_per_second": 4.293,
132
+ "step": 1272
133
+ },
134
+ {
135
+ "epoch": 8.99,
136
+ "eval_accuracy": 0.8678500986193294,
137
+ "eval_f1": 0.8618200567156483,
138
+ "eval_loss": 0.6177182793617249,
139
+ "eval_precision_following": 0.8383219954648526,
140
+ "eval_precision_not_following": 0.9030253916801729,
141
+ "eval_recall_following": 0.9114891518737672,
142
+ "eval_recall_not_following": 0.8242110453648915,
143
+ "eval_runtime": 7.6101,
144
+ "eval_samples_per_second": 1065.946,
145
+ "eval_steps_per_second": 4.205,
146
+ "step": 1431
147
+ },
148
+ {
149
+ "epoch": 9.43,
150
+ "learning_rate": 4.856969809914275e-07,
151
+ "loss": 0.6261,
152
+ "step": 1500
153
+ },
154
+ {
155
+ "epoch": 9.99,
156
+ "eval_accuracy": 0.8709319526627219,
157
+ "eval_f1": 0.8653029718255499,
158
+ "eval_loss": 0.6082141995429993,
159
+ "eval_precision_following": 0.842320819112628,
160
+ "eval_precision_not_following": 0.9047619047619048,
161
+ "eval_recall_following": 0.9127218934911243,
162
+ "eval_recall_not_following": 0.8291420118343196,
163
+ "eval_runtime": 6.5573,
164
+ "eval_samples_per_second": 1237.093,
165
+ "eval_steps_per_second": 4.88,
166
+ "step": 1590
167
+ },
168
+ {
169
+ "epoch": 10.99,
170
+ "eval_accuracy": 0.8730276134122288,
171
+ "eval_f1": 0.8682190378710338,
172
+ "eval_loss": 0.5987269282341003,
173
+ "eval_precision_following": 0.84765625,
174
+ "eval_precision_not_following": 0.9023936170212766,
175
+ "eval_recall_following": 0.909516765285996,
176
+ "eval_recall_not_following": 0.8365384615384616,
177
+ "eval_runtime": 6.5989,
178
+ "eval_samples_per_second": 1229.295,
179
+ "eval_steps_per_second": 4.849,
180
+ "step": 1749
181
+ },
182
+ {
183
+ "epoch": 11.99,
184
+ "eval_accuracy": 0.8735207100591716,
185
+ "eval_f1": 0.8683940482298614,
186
+ "eval_loss": 0.5899477601051331,
187
+ "eval_precision_following": 0.846523330283623,
188
+ "eval_precision_not_following": 0.9050802139037433,
189
+ "eval_recall_following": 0.9124753451676528,
190
+ "eval_recall_not_following": 0.8345660749506904,
191
+ "eval_runtime": 6.3563,
192
+ "eval_samples_per_second": 1276.22,
193
+ "eval_steps_per_second": 5.034,
194
+ "step": 1908
195
+ },
196
+ {
197
+ "epoch": 12.58,
198
+ "learning_rate": 4.6240216175922476e-07,
199
+ "loss": 0.5942,
200
+ "step": 2000
201
+ },
202
+ {
203
+ "epoch": 12.99,
204
+ "eval_accuracy": 0.8745069033530573,
205
+ "eval_f1": 0.869218910585817,
206
+ "eval_loss": 0.581299901008606,
207
+ "eval_precision_following": 0.8464872262773723,
208
+ "eval_precision_not_following": 0.9074570815450643,
209
+ "eval_recall_following": 0.9149408284023669,
210
+ "eval_recall_not_following": 0.8340729783037475,
211
+ "eval_runtime": 6.309,
212
+ "eval_samples_per_second": 1285.773,
213
+ "eval_steps_per_second": 5.072,
214
+ "step": 2067
215
+ },
216
+ {
217
+ "epoch": 13.99,
218
+ "eval_accuracy": 0.8746301775147929,
219
+ "eval_f1": 0.8694982676761196,
220
+ "eval_loss": 0.5730020403862,
221
+ "eval_precision_following": 0.8473142857142857,
222
+ "eval_precision_not_following": 0.9066095798769066,
223
+ "eval_recall_following": 0.9139546351084813,
224
+ "eval_recall_not_following": 0.8353057199211046,
225
+ "eval_runtime": 6.4991,
226
+ "eval_samples_per_second": 1248.179,
227
+ "eval_steps_per_second": 4.924,
228
+ "step": 2226
229
+ },
230
+ {
231
+ "epoch": 14.99,
232
+ "eval_accuracy": 0.8747534516765286,
233
+ "eval_f1": 0.8692743180648481,
234
+ "eval_loss": 0.5653589963912964,
235
+ "eval_precision_following": 0.845768880800728,
236
+ "eval_precision_not_following": 0.9090419806243273,
237
+ "eval_recall_following": 0.9166666666666666,
238
+ "eval_recall_not_following": 0.8328402366863905,
239
+ "eval_runtime": 6.4333,
240
+ "eval_samples_per_second": 1260.941,
241
+ "eval_steps_per_second": 4.974,
242
+ "step": 2385
243
+ },
244
+ {
245
+ "epoch": 15.72,
246
+ "learning_rate": 4.3910734252702195e-07,
247
+ "loss": 0.564,
248
+ "step": 2500
249
+ },
250
+ {
251
+ "epoch": 15.99,
252
+ "eval_accuracy": 0.8768491124260355,
253
+ "eval_f1": 0.8722016118715621,
254
+ "eval_loss": 0.5576348900794983,
255
+ "eval_precision_following": 0.8512985520569983,
256
+ "eval_precision_not_following": 0.9064078702472746,
257
+ "eval_recall_following": 0.9132149901380671,
258
+ "eval_recall_not_following": 0.840483234714004,
259
+ "eval_runtime": 6.4791,
260
+ "eval_samples_per_second": 1252.033,
261
+ "eval_steps_per_second": 4.939,
262
+ "step": 2544
263
+ },
264
+ {
265
+ "epoch": 16.99,
266
+ "eval_accuracy": 0.8764792899408284,
267
+ "eval_f1": 0.8712413261372397,
268
+ "eval_loss": 0.5506843328475952,
269
+ "eval_precision_following": 0.8481532147742818,
270
+ "eval_precision_not_following": 0.9098228663446055,
271
+ "eval_recall_following": 0.9171597633136095,
272
+ "eval_recall_not_following": 0.8357988165680473,
273
+ "eval_runtime": 7.9718,
274
+ "eval_samples_per_second": 1017.585,
275
+ "eval_steps_per_second": 4.014,
276
+ "step": 2703
277
+ },
278
+ {
279
+ "epoch": 17.99,
280
+ "eval_accuracy": 0.8764792899408284,
281
+ "eval_f1": 0.8712744090441932,
282
+ "eval_loss": 0.5431817173957825,
283
+ "eval_precision_following": 0.8483120437956204,
284
+ "eval_precision_not_following": 0.9096030042918455,
285
+ "eval_recall_following": 0.9169132149901381,
286
+ "eval_recall_not_following": 0.8360453648915187,
287
+ "eval_runtime": 7.4474,
288
+ "eval_samples_per_second": 1089.246,
289
+ "eval_steps_per_second": 4.297,
290
+ "step": 2862
291
+ },
292
+ {
293
+ "epoch": 18.86,
294
+ "learning_rate": 4.158125232948192e-07,
295
+ "loss": 0.5372,
296
+ "step": 3000
297
+ },
298
+ {
299
+ "epoch": 18.99,
300
+ "eval_accuracy": 0.8772189349112426,
301
+ "eval_f1": 0.8721109399075501,
302
+ "eval_loss": 0.5359050631523132,
303
+ "eval_precision_following": 0.8493150684931506,
304
+ "eval_precision_not_following": 0.909967845659164,
305
+ "eval_recall_following": 0.9171597633136095,
306
+ "eval_recall_not_following": 0.8372781065088757,
307
+ "eval_runtime": 7.5381,
308
+ "eval_samples_per_second": 1076.128,
309
+ "eval_steps_per_second": 4.245,
310
+ "step": 3021
311
+ },
312
+ {
313
+ "epoch": 19.99,
314
+ "eval_accuracy": 0.8778353057199211,
315
+ "eval_f1": 0.8725401929260451,
316
+ "eval_loss": 0.5289158821105957,
317
+ "eval_precision_following": 0.8488504438880037,
318
+ "eval_precision_not_following": 0.9120731379403065,
319
+ "eval_recall_following": 0.9193786982248521,
320
+ "eval_recall_not_following": 0.8362919132149902,
321
+ "eval_runtime": 6.6346,
322
+ "eval_samples_per_second": 1222.686,
323
+ "eval_steps_per_second": 4.823,
324
+ "step": 3180
325
+ },
326
+ {
327
+ "epoch": 20.99,
328
+ "eval_accuracy": 0.8789447731755424,
329
+ "eval_f1": 0.8737139917695474,
330
+ "eval_loss": 0.5221996307373047,
331
+ "eval_precision_following": 0.8499544626593807,
332
+ "eval_precision_not_following": 0.9131720430107527,
333
+ "eval_recall_following": 0.9203648915187377,
334
+ "eval_recall_not_following": 0.8375246548323472,
335
+ "eval_runtime": 6.5308,
336
+ "eval_samples_per_second": 1242.11,
337
+ "eval_steps_per_second": 4.9,
338
+ "step": 3339
339
+ },
340
+ {
341
+ "epoch": 21.99,
342
+ "eval_accuracy": 0.8796844181459567,
343
+ "eval_f1": 0.8742592115434167,
344
+ "eval_loss": 0.5158143639564514,
345
+ "eval_precision_following": 0.8495233772128915,
346
+ "eval_precision_not_following": 0.9155423637344846,
347
+ "eval_recall_following": 0.9228303747534516,
348
+ "eval_recall_not_following": 0.8365384615384616,
349
+ "eval_runtime": 6.3007,
350
+ "eval_samples_per_second": 1287.474,
351
+ "eval_steps_per_second": 5.079,
352
+ "step": 3498
353
+ },
354
+ {
355
+ "epoch": 22.01,
356
+ "learning_rate": 3.925177040626165e-07,
357
+ "loss": 0.5126,
358
+ "step": 3500
359
+ },
360
+ {
361
+ "epoch": 22.99,
362
+ "eval_accuracy": 0.8798076923076923,
363
+ "eval_f1": 0.8747269690350764,
364
+ "eval_loss": 0.5094554424285889,
365
+ "eval_precision_following": 0.8513112884834664,
366
+ "eval_precision_not_following": 0.9133351220821035,
367
+ "eval_recall_following": 0.9203648915187377,
368
+ "eval_recall_not_following": 0.8392504930966469,
369
+ "eval_runtime": 6.4725,
370
+ "eval_samples_per_second": 1253.304,
371
+ "eval_steps_per_second": 4.944,
372
+ "step": 3657
373
+ },
374
+ {
375
+ "epoch": 23.99,
376
+ "eval_accuracy": 0.8793145956607495,
377
+ "eval_f1": 0.8743744385987424,
378
+ "eval_loss": 0.5033257603645325,
379
+ "eval_precision_following": 0.8516571428571429,
380
+ "eval_precision_not_following": 0.9116938720899117,
381
+ "eval_recall_following": 0.9186390532544378,
382
+ "eval_recall_not_following": 0.8399901380670611,
383
+ "eval_runtime": 6.5235,
384
+ "eval_samples_per_second": 1243.504,
385
+ "eval_steps_per_second": 4.905,
386
+ "step": 3816
387
+ },
388
+ {
389
+ "epoch": 24.99,
390
+ "eval_accuracy": 0.8806706114398422,
391
+ "eval_f1": 0.8757062146892656,
392
+ "eval_loss": 0.49730098247528076,
393
+ "eval_precision_following": 0.8525114155251141,
394
+ "eval_precision_not_following": 0.9137191854233655,
395
+ "eval_recall_following": 0.9206114398422091,
396
+ "eval_recall_not_following": 0.8407297830374754,
397
+ "eval_runtime": 6.4549,
398
+ "eval_samples_per_second": 1256.725,
399
+ "eval_steps_per_second": 4.957,
400
+ "step": 3975
401
+ },
402
+ {
403
+ "epoch": 25.16,
404
+ "learning_rate": 3.692228848304137e-07,
405
+ "loss": 0.4884,
406
+ "step": 4000
407
+ },
408
+ {
409
+ "epoch": 25.99,
410
+ "eval_accuracy": 0.8803007889546351,
411
+ "eval_f1": 0.8751125401929261,
412
+ "eval_loss": 0.4917982518672943,
413
+ "eval_precision_following": 0.8511267926246301,
414
+ "eval_precision_not_following": 0.9147620328045173,
415
+ "eval_recall_following": 0.921844181459566,
416
+ "eval_recall_not_following": 0.8387573964497042,
417
+ "eval_runtime": 7.4346,
418
+ "eval_samples_per_second": 1091.112,
419
+ "eval_steps_per_second": 4.304,
420
+ "step": 4134
421
+ },
422
+ {
423
+ "epoch": 26.99,
424
+ "eval_accuracy": 0.8814102564102564,
425
+ "eval_f1": 0.8765717218373107,
426
+ "eval_loss": 0.485965758562088,
427
+ "eval_precision_following": 0.8536808413351623,
428
+ "eval_precision_not_following": 0.9138576779026217,
429
+ "eval_recall_following": 0.9206114398422091,
430
+ "eval_recall_not_following": 0.8422090729783037,
431
+ "eval_runtime": 7.8472,
432
+ "eval_samples_per_second": 1033.747,
433
+ "eval_steps_per_second": 4.078,
434
+ "step": 4293
435
+ },
436
+ {
437
+ "epoch": 27.99,
438
+ "eval_accuracy": 0.8815335305719921,
439
+ "eval_f1": 0.8769053413603177,
440
+ "eval_loss": 0.48036113381385803,
441
+ "eval_precision_following": 0.8548498050905755,
442
+ "eval_precision_not_following": 0.9125566515595841,
443
+ "eval_recall_following": 0.9191321499013807,
444
+ "eval_recall_not_following": 0.8439349112426036,
445
+ "eval_runtime": 6.2961,
446
+ "eval_samples_per_second": 1288.426,
447
+ "eval_steps_per_second": 5.083,
448
+ "step": 4452
449
+ },
450
+ {
451
+ "epoch": 28.3,
452
+ "learning_rate": 3.4592806559821093e-07,
453
+ "loss": 0.4673,
454
+ "step": 4500
455
+ },
456
+ {
457
+ "epoch": 28.99,
458
+ "eval_accuracy": 0.8814102564102564,
459
+ "eval_f1": 0.8765083440308087,
460
+ "eval_loss": 0.47532862424850464,
461
+ "eval_precision_following": 0.8533576975788031,
462
+ "eval_precision_not_following": 0.914301017675415,
463
+ "eval_recall_following": 0.9211045364891519,
464
+ "eval_recall_not_following": 0.841715976331361,
465
+ "eval_runtime": 6.4255,
466
+ "eval_samples_per_second": 1262.466,
467
+ "eval_steps_per_second": 4.98,
468
+ "step": 4611
469
+ },
470
+ {
471
+ "epoch": 29.99,
472
+ "eval_accuracy": 0.8810404339250493,
473
+ "eval_f1": 0.8754356525106493,
474
+ "eval_loss": 0.47099417448043823,
475
+ "eval_precision_following": 0.8495815426374124,
476
+ "eval_precision_not_following": 0.9187212137632078,
477
+ "eval_recall_following": 0.9260355029585798,
478
+ "eval_recall_not_following": 0.8360453648915187,
479
+ "eval_runtime": 6.5611,
480
+ "eval_samples_per_second": 1236.373,
481
+ "eval_steps_per_second": 4.877,
482
+ "step": 4770
483
+ },
484
+ {
485
+ "epoch": 30.99,
486
+ "eval_accuracy": 0.8814102564102564,
487
+ "eval_f1": 0.8758709677419355,
488
+ "eval_loss": 0.465981125831604,
489
+ "eval_precision_following": 0.8501584427342689,
490
+ "eval_precision_not_following": 0.9187872225230103,
491
+ "eval_recall_following": 0.9260355029585798,
492
+ "eval_recall_not_following": 0.8367850098619329,
493
+ "eval_runtime": 6.4473,
494
+ "eval_samples_per_second": 1258.207,
495
+ "eval_steps_per_second": 4.963,
496
+ "step": 4929
497
+ },
498
+ {
499
+ "epoch": 31.44,
500
+ "learning_rate": 3.2263324636600817e-07,
501
+ "loss": 0.4474,
502
+ "step": 5000
503
+ },
504
+ {
505
+ "epoch": 31.99,
506
+ "eval_accuracy": 0.8817800788954635,
507
+ "eval_f1": 0.8768460254269936,
508
+ "eval_loss": 0.4605511724948883,
509
+ "eval_precision_following": 0.853458114585711,
510
+ "eval_precision_not_following": 0.9150361833288663,
511
+ "eval_recall_following": 0.921844181459566,
512
+ "eval_recall_not_following": 0.841715976331361,
513
+ "eval_runtime": 7.8836,
514
+ "eval_samples_per_second": 1028.968,
515
+ "eval_steps_per_second": 4.059,
516
+ "step": 5088
517
+ },
518
+ {
519
+ "epoch": 32.99,
520
+ "eval_accuracy": 0.8826429980276134,
521
+ "eval_f1": 0.877540519680988,
522
+ "eval_loss": 0.45592227578163147,
523
+ "eval_precision_following": 0.8532089212562586,
524
+ "eval_precision_not_following": 0.9174287251210328,
525
+ "eval_recall_following": 0.9243096646942801,
526
+ "eval_recall_not_following": 0.8409763313609467,
527
+ "eval_runtime": 7.6557,
528
+ "eval_samples_per_second": 1059.596,
529
+ "eval_steps_per_second": 4.18,
530
+ "step": 5247
531
+ },
532
+ {
533
+ "epoch": 33.99,
534
+ "eval_accuracy": 0.8832593688362919,
535
+ "eval_f1": 0.8785118665811418,
536
+ "eval_loss": 0.45115283131599426,
537
+ "eval_precision_following": 0.8554767893894352,
538
+ "eval_precision_not_following": 0.9157528751002942,
539
+ "eval_recall_following": 0.9223372781065089,
540
+ "eval_recall_not_following": 0.8441814595660749,
541
+ "eval_runtime": 6.8753,
542
+ "eval_samples_per_second": 1179.868,
543
+ "eval_steps_per_second": 4.654,
544
+ "step": 5406
545
+ },
546
+ {
547
+ "epoch": 34.59,
548
+ "learning_rate": 2.993384271338054e-07,
549
+ "loss": 0.4292,
550
+ "step": 5500
551
+ },
552
+ {
553
+ "epoch": 34.99,
554
+ "eval_accuracy": 0.8826429980276134,
555
+ "eval_f1": 0.877351198144808,
556
+ "eval_loss": 0.4472413659095764,
557
+ "eval_precision_following": 0.8522469359963686,
558
+ "eval_precision_not_following": 0.9187803561791689,
559
+ "eval_recall_following": 0.9257889546351085,
560
+ "eval_recall_not_following": 0.8394970414201184,
561
+ "eval_runtime": 7.6512,
562
+ "eval_samples_per_second": 1060.227,
563
+ "eval_steps_per_second": 4.182,
564
+ "step": 5565
565
+ },
566
+ {
567
+ "epoch": 35.99,
568
+ "eval_accuracy": 0.8825197238658777,
569
+ "eval_f1": 0.8775221693869684,
570
+ "eval_loss": 0.44297003746032715,
571
+ "eval_precision_following": 0.8536585365853658,
572
+ "eval_precision_not_following": 0.916510067114094,
573
+ "eval_recall_following": 0.9233234714003945,
574
+ "eval_recall_not_following": 0.841715976331361,
575
+ "eval_runtime": 6.5867,
576
+ "eval_samples_per_second": 1231.58,
577
+ "eval_steps_per_second": 4.858,
578
+ "step": 5724
579
+ },
580
+ {
581
+ "epoch": 36.99,
582
+ "eval_accuracy": 0.8827662721893491,
583
+ "eval_f1": 0.8777163430628777,
584
+ "eval_loss": 0.4388849139213562,
585
+ "eval_precision_following": 0.8535641084035527,
586
+ "eval_precision_not_following": 0.91722655200215,
587
+ "eval_recall_following": 0.9240631163708086,
588
+ "eval_recall_not_following": 0.8414694280078896,
589
+ "eval_runtime": 7.7033,
590
+ "eval_samples_per_second": 1053.059,
591
+ "eval_steps_per_second": 4.154,
592
+ "step": 5883
593
+ },
594
+ {
595
+ "epoch": 37.73,
596
+ "learning_rate": 2.760436079016027e-07,
597
+ "loss": 0.4128,
598
+ "step": 6000
599
+ },
600
+ {
601
+ "epoch": 37.99,
602
+ "eval_accuracy": 0.8819033530571992,
603
+ "eval_f1": 0.8765145656096932,
604
+ "eval_loss": 0.4353000819683075,
605
+ "eval_precision_following": 0.8512471655328798,
606
+ "eval_precision_not_following": 0.9184224743381956,
607
+ "eval_recall_following": 0.9255424063116371,
608
+ "eval_recall_not_following": 0.8382642998027613,
609
+ "eval_runtime": 7.9842,
610
+ "eval_samples_per_second": 1016.012,
611
+ "eval_steps_per_second": 4.008,
612
+ "step": 6042
613
+ },
614
+ {
615
+ "epoch": 38.99,
616
+ "eval_accuracy": 0.8832593688362919,
617
+ "eval_f1": 0.878324553514069,
618
+ "eval_loss": 0.4311205744743347,
619
+ "eval_precision_following": 0.8545039908779931,
620
+ "eval_precision_not_following": 0.9170914944995975,
621
+ "eval_recall_following": 0.9238165680473372,
622
+ "eval_recall_not_following": 0.8427021696252466,
623
+ "eval_runtime": 7.7705,
624
+ "eval_samples_per_second": 1043.95,
625
+ "eval_steps_per_second": 4.118,
626
+ "step": 6201
627
+ },
628
+ {
629
+ "epoch": 39.99,
630
+ "eval_accuracy": 0.8835059171597633,
631
+ "eval_f1": 0.8785503148695541,
632
+ "eval_loss": 0.42720890045166016,
633
+ "eval_precision_following": 0.8545703214041486,
634
+ "eval_precision_not_following": 0.9175838926174497,
635
+ "eval_recall_following": 0.9243096646942801,
636
+ "eval_recall_not_following": 0.8427021696252466,
637
+ "eval_runtime": 7.4652,
638
+ "eval_samples_per_second": 1086.638,
639
+ "eval_steps_per_second": 4.287,
640
+ "step": 6360
641
+ },
642
+ {
643
+ "epoch": 40.88,
644
+ "learning_rate": 2.527487886693999e-07,
645
+ "loss": 0.3974,
646
+ "step": 6500
647
+ },
648
+ {
649
+ "epoch": 40.99,
650
+ "eval_accuracy": 0.8841222879684418,
651
+ "eval_f1": 0.8793324775353017,
652
+ "eval_loss": 0.4234888553619385,
653
+ "eval_precision_following": 0.8558702603928735,
654
+ "eval_precision_not_following": 0.9172469201928227,
655
+ "eval_recall_following": 0.9238165680473372,
656
+ "eval_recall_not_following": 0.8444280078895463,
657
+ "eval_runtime": 7.8319,
658
+ "eval_samples_per_second": 1035.77,
659
+ "eval_steps_per_second": 4.086,
660
+ "step": 6519
661
+ },
662
+ {
663
+ "epoch": 41.99,
664
+ "eval_accuracy": 0.8828895463510849,
665
+ "eval_f1": 0.8777977874967842,
666
+ "eval_loss": 0.42032715678215027,
667
+ "eval_precision_following": 0.8534365043240782,
668
+ "eval_precision_not_following": 0.9176976869284562,
669
+ "eval_recall_following": 0.9245562130177515,
670
+ "eval_recall_not_following": 0.8412228796844181,
671
+ "eval_runtime": 6.557,
672
+ "eval_samples_per_second": 1237.159,
673
+ "eval_steps_per_second": 4.88,
674
+ "step": 6678
675
+ },
676
+ {
677
+ "epoch": 42.99,
678
+ "eval_accuracy": 0.8838757396449705,
679
+ "eval_f1": 0.8787956767884715,
680
+ "eval_loss": 0.41689053177833557,
681
+ "eval_precision_following": 0.8541856232939036,
682
+ "eval_precision_not_following": 0.9189989235737352,
683
+ "eval_recall_following": 0.9257889546351085,
684
+ "eval_recall_not_following": 0.8419625246548323,
685
+ "eval_runtime": 6.3499,
686
+ "eval_samples_per_second": 1277.502,
687
+ "eval_steps_per_second": 5.039,
688
+ "step": 6837
689
+ },
690
+ {
691
+ "epoch": 43.99,
692
+ "eval_accuracy": 0.8838757396449705,
693
+ "eval_f1": 0.8789514263685426,
694
+ "eval_loss": 0.413469135761261,
695
+ "eval_precision_following": 0.8549931600547196,
696
+ "eval_precision_not_following": 0.9178743961352657,
697
+ "eval_recall_following": 0.9245562130177515,
698
+ "eval_recall_not_following": 0.8431952662721893,
699
+ "eval_runtime": 6.2083,
700
+ "eval_samples_per_second": 1306.64,
701
+ "eval_steps_per_second": 5.154,
702
+ "step": 6996
703
+ },
704
+ {
705
+ "epoch": 44.03,
706
+ "learning_rate": 2.2945396943719717e-07,
707
+ "loss": 0.3843,
708
+ "step": 7000
709
+ },
710
+ {
711
+ "epoch": 44.99,
712
+ "eval_accuracy": 0.883629191321499,
713
+ "eval_f1": 0.878475798146241,
714
+ "eval_loss": 0.4109957814216614,
715
+ "eval_precision_following": 0.8536363636363636,
716
+ "eval_precision_not_following": 0.9191810344827587,
717
+ "eval_recall_following": 0.9260355029585798,
718
+ "eval_recall_not_following": 0.8412228796844181,
719
+ "eval_runtime": 6.439,
720
+ "eval_samples_per_second": 1259.826,
721
+ "eval_steps_per_second": 4.97,
722
+ "step": 7155
723
+ },
724
+ {
725
+ "epoch": 45.99,
726
+ "eval_accuracy": 0.8832593688362919,
727
+ "eval_f1": 0.877916720381591,
728
+ "eval_loss": 0.40848881006240845,
729
+ "eval_precision_following": 0.8524144184992065,
730
+ "eval_precision_not_following": 0.920021615779519,
731
+ "eval_recall_following": 0.9270216962524654,
732
+ "eval_recall_not_following": 0.8394970414201184,
733
+ "eval_runtime": 6.4019,
734
+ "eval_samples_per_second": 1267.122,
735
+ "eval_steps_per_second": 4.999,
736
+ "step": 7314
737
+ },
738
+ {
739
+ "epoch": 46.99,
740
+ "eval_accuracy": 0.8830128205128205,
741
+ "eval_f1": 0.877973511636878,
742
+ "eval_loss": 0.405333548784256,
743
+ "eval_precision_following": 0.8537918469596902,
744
+ "eval_precision_not_following": 0.917495296963182,
745
+ "eval_recall_following": 0.9243096646942801,
746
+ "eval_recall_not_following": 0.841715976331361,
747
+ "eval_runtime": 6.585,
748
+ "eval_samples_per_second": 1231.895,
749
+ "eval_steps_per_second": 4.86,
750
+ "step": 7473
751
+ },
752
+ {
753
+ "epoch": 47.17,
754
+ "learning_rate": 2.061591502049944e-07,
755
+ "loss": 0.3713,
756
+ "step": 7500
757
+ },
758
+ {
759
+ "epoch": 47.99,
760
+ "eval_accuracy": 0.883629191321499,
761
+ "eval_f1": 0.8785383427689141,
762
+ "eval_loss": 0.4025915265083313,
763
+ "eval_precision_following": 0.8539581437670609,
764
+ "eval_precision_not_following": 0.918729817007535,
765
+ "eval_recall_following": 0.9255424063116371,
766
+ "eval_recall_not_following": 0.841715976331361,
767
+ "eval_runtime": 6.482,
768
+ "eval_samples_per_second": 1251.458,
769
+ "eval_steps_per_second": 4.937,
770
+ "step": 7632
771
+ },
772
+ {
773
+ "epoch": 48.99,
774
+ "eval_accuracy": 0.8842455621301775,
775
+ "eval_f1": 0.8792593545068792,
776
+ "eval_loss": 0.39974769949913025,
777
+ "eval_precision_following": 0.854930539740378,
778
+ "eval_precision_not_following": 0.9188390217683419,
779
+ "eval_recall_following": 0.9255424063116371,
780
+ "eval_recall_not_following": 0.842948717948718,
781
+ "eval_runtime": 6.8714,
782
+ "eval_samples_per_second": 1180.552,
783
+ "eval_steps_per_second": 4.657,
784
+ "step": 7791
785
+ },
786
+ {
787
+ "epoch": 49.99,
788
+ "eval_accuracy": 0.884492110453649,
789
+ "eval_f1": 0.8796094051137093,
790
+ "eval_loss": 0.39722564816474915,
791
+ "eval_precision_following": 0.8556442417331813,
792
+ "eval_precision_not_following": 0.918433056077274,
793
+ "eval_recall_following": 0.9250493096646942,
794
+ "eval_recall_not_following": 0.8439349112426036,
795
+ "eval_runtime": 6.7422,
796
+ "eval_samples_per_second": 1203.167,
797
+ "eval_steps_per_second": 4.746,
798
+ "step": 7950
799
+ },
800
+ {
801
+ "epoch": 50.31,
802
+ "learning_rate": 1.8286433097279163e-07,
803
+ "loss": 0.3602,
804
+ "step": 8000
805
+ },
806
+ {
807
+ "epoch": 50.99,
808
+ "eval_accuracy": 0.8839990138067061,
809
+ "eval_f1": 0.879002185932879,
810
+ "eval_loss": 0.394969642162323,
811
+ "eval_precision_following": 0.8547028011842405,
812
+ "eval_precision_not_following": 0.9185702768073098,
813
+ "eval_recall_following": 0.9252958579881657,
814
+ "eval_recall_not_following": 0.8427021696252466,
815
+ "eval_runtime": 6.3463,
816
+ "eval_samples_per_second": 1278.229,
817
+ "eval_steps_per_second": 5.042,
818
+ "step": 8109
819
+ },
820
+ {
821
+ "epoch": 51.99,
822
+ "eval_accuracy": 0.8833826429980276,
823
+ "eval_f1": 0.8781555899021123,
824
+ "eval_loss": 0.39329206943511963,
825
+ "eval_precision_following": 0.8530881017257039,
826
+ "eval_precision_not_following": 0.9193635382955772,
827
+ "eval_recall_following": 0.9262820512820513,
828
+ "eval_recall_not_following": 0.840483234714004,
829
+ "eval_runtime": 6.7431,
830
+ "eval_samples_per_second": 1203.016,
831
+ "eval_steps_per_second": 4.746,
832
+ "step": 8268
833
+ },
834
+ {
835
+ "epoch": 52.99,
836
+ "eval_accuracy": 0.8842455621301775,
837
+ "eval_f1": 0.8791039011201237,
838
+ "eval_loss": 0.3910701274871826,
839
+ "eval_precision_following": 0.8541240627130198,
840
+ "eval_precision_not_following": 0.919967663702506,
841
+ "eval_recall_following": 0.9267751479289941,
842
+ "eval_recall_not_following": 0.841715976331361,
843
+ "eval_runtime": 6.5474,
844
+ "eval_samples_per_second": 1238.969,
845
+ "eval_steps_per_second": 4.887,
846
+ "step": 8427
847
+ },
848
+ {
849
+ "epoch": 53.46,
850
+ "learning_rate": 1.5956951174058888e-07,
851
+ "loss": 0.3507,
852
+ "step": 8500
853
+ },
854
+ {
855
+ "epoch": 53.99,
856
+ "eval_accuracy": 0.8837524654832347,
857
+ "eval_f1": 0.8784950392990594,
858
+ "eval_loss": 0.3893094062805176,
859
+ "eval_precision_following": 0.8531881098252779,
860
+ "eval_precision_not_following": 0.9201079622132253,
861
+ "eval_recall_following": 0.9270216962524654,
862
+ "eval_recall_not_following": 0.840483234714004,
863
+ "eval_runtime": 6.5965,
864
+ "eval_samples_per_second": 1229.738,
865
+ "eval_steps_per_second": 4.851,
866
+ "step": 8586
867
+ },
868
+ {
869
+ "epoch": 54.99,
870
+ "eval_accuracy": 0.8839990138067061,
871
+ "eval_f1": 0.8786589297227595,
872
+ "eval_loss": 0.3876223862171173,
873
+ "eval_precision_following": 0.8529345116700657,
874
+ "eval_precision_not_following": 0.9210597458772641,
875
+ "eval_recall_following": 0.928007889546351,
876
+ "eval_recall_not_following": 0.8399901380670611,
877
+ "eval_runtime": 6.4132,
878
+ "eval_samples_per_second": 1264.882,
879
+ "eval_steps_per_second": 4.99,
880
+ "step": 8745
881
+ },
882
+ {
883
+ "epoch": 55.99,
884
+ "eval_accuracy": 0.8841222879684418,
885
+ "eval_f1": 0.8789595673448365,
886
+ "eval_loss": 0.38539403676986694,
887
+ "eval_precision_following": 0.8539300318037256,
888
+ "eval_precision_not_following": 0.9199460916442048,
889
+ "eval_recall_following": 0.9267751479289941,
890
+ "eval_recall_not_following": 0.8414694280078896,
891
+ "eval_runtime": 6.2428,
892
+ "eval_samples_per_second": 1299.421,
893
+ "eval_steps_per_second": 5.126,
894
+ "step": 8904
895
+ },
896
+ {
897
+ "epoch": 56.6,
898
+ "learning_rate": 1.3627469250838615e-07,
899
+ "loss": 0.3426,
900
+ "step": 9000
901
+ },
902
+ {
903
+ "epoch": 56.99,
904
+ "eval_accuracy": 0.8842455621301775,
905
+ "eval_f1": 0.8789480469253578,
906
+ "eval_loss": 0.38400083780288696,
907
+ "eval_precision_following": 0.8533212423486738,
908
+ "eval_precision_not_following": 0.9211024047554714,
909
+ "eval_recall_following": 0.928007889546351,
910
+ "eval_recall_not_following": 0.840483234714004,
911
+ "eval_runtime": 6.3044,
912
+ "eval_samples_per_second": 1286.728,
913
+ "eval_steps_per_second": 5.076,
914
+ "step": 9063
915
+ },
916
+ {
917
+ "epoch": 57.99,
918
+ "eval_accuracy": 0.8847386587771203,
919
+ "eval_f1": 0.8797118229769716,
920
+ "eval_loss": 0.38182100653648376,
921
+ "eval_precision_following": 0.8550625711035267,
922
+ "eval_precision_not_following": 0.9198278181329029,
923
+ "eval_recall_following": 0.9265285996055227,
924
+ "eval_recall_not_following": 0.842948717948718,
925
+ "eval_runtime": 6.3112,
926
+ "eval_samples_per_second": 1285.343,
927
+ "eval_steps_per_second": 5.07,
928
+ "step": 9222
929
+ },
930
+ {
931
+ "epoch": 58.99,
932
+ "eval_accuracy": 0.8847386587771203,
933
+ "eval_f1": 0.8797118229769716,
934
+ "eval_loss": 0.3803881108760834,
935
+ "eval_precision_following": 0.8550625711035267,
936
+ "eval_precision_not_following": 0.9198278181329029,
937
+ "eval_recall_following": 0.9265285996055227,
938
+ "eval_recall_not_following": 0.842948717948718,
939
+ "eval_runtime": 6.8641,
940
+ "eval_samples_per_second": 1181.797,
941
+ "eval_steps_per_second": 4.662,
942
+ "step": 9381
943
+ },
944
+ {
945
+ "epoch": 59.74,
946
+ "learning_rate": 1.1297987327618338e-07,
947
+ "loss": 0.3357,
948
+ "step": 9500
949
+ },
950
+ {
951
+ "epoch": 59.99,
952
+ "eval_accuracy": 0.884492110453649,
953
+ "eval_f1": 0.8792370150792628,
954
+ "eval_loss": 0.37948256731033325,
955
+ "eval_precision_following": 0.8537083238829667,
956
+ "eval_precision_not_following": 0.9211450175533351,
957
+ "eval_recall_following": 0.928007889546351,
958
+ "eval_recall_not_following": 0.8409763313609467,
959
+ "eval_runtime": 6.5287,
960
+ "eval_samples_per_second": 1242.519,
961
+ "eval_steps_per_second": 4.901,
962
+ "step": 9540
963
+ },
964
+ {
965
+ "epoch": 60.99,
966
+ "eval_accuracy": 0.8846153846153846,
967
+ "eval_f1": 0.8794125225457357,
968
+ "eval_loss": 0.37801429629325867,
969
+ "eval_precision_following": 0.85406264185202,
970
+ "eval_precision_not_following": 0.9209390178089585,
971
+ "eval_recall_following": 0.9277613412228797,
972
+ "eval_recall_not_following": 0.8414694280078896,
973
+ "eval_runtime": 6.9538,
974
+ "eval_samples_per_second": 1166.564,
975
+ "eval_steps_per_second": 4.602,
976
+ "step": 9699
977
+ },
978
+ {
979
+ "epoch": 61.99,
980
+ "eval_accuracy": 0.8847386587771203,
981
+ "eval_f1": 0.8796498905908097,
982
+ "eval_loss": 0.3765193819999695,
983
+ "eval_precision_following": 0.8547397135712662,
984
+ "eval_precision_not_following": 0.9202800969566388,
985
+ "eval_recall_following": 0.9270216962524654,
986
+ "eval_recall_not_following": 0.8424556213017751,
987
+ "eval_runtime": 6.5515,
988
+ "eval_samples_per_second": 1238.193,
989
+ "eval_steps_per_second": 4.884,
990
+ "step": 9858
991
+ },
992
+ {
993
+ "epoch": 62.89,
994
+ "learning_rate": 8.968505404398062e-08,
995
+ "loss": 0.3296,
996
+ "step": 10000
997
+ },
998
+ {
999
+ "epoch": 62.99,
1000
+ "eval_accuracy": 0.8848619329388561,
1001
+ "eval_f1": 0.8798250128667009,
1002
+ "eval_loss": 0.375373512506485,
1003
+ "eval_precision_following": 0.8550955414012739,
1004
+ "eval_precision_not_following": 0.920075349838536,
1005
+ "eval_recall_following": 0.9267751479289941,
1006
+ "eval_recall_not_following": 0.842948717948718,
1007
+ "eval_runtime": 6.5325,
1008
+ "eval_samples_per_second": 1241.793,
1009
+ "eval_steps_per_second": 4.899,
1010
+ "step": 10017
1011
+ },
1012
+ {
1013
+ "epoch": 63.99,
1014
+ "eval_accuracy": 0.8846153846153846,
1015
+ "eval_f1": 0.8794435857805255,
1016
+ "eval_loss": 0.37458762526512146,
1017
+ "eval_precision_following": 0.8542234332425068,
1018
+ "eval_precision_not_following": 0.9207119741100324,
1019
+ "eval_recall_following": 0.9275147928994083,
1020
+ "eval_recall_not_following": 0.841715976331361,
1021
+ "eval_runtime": 6.8668,
1022
+ "eval_samples_per_second": 1181.329,
1023
+ "eval_steps_per_second": 4.66,
1024
+ "step": 10176
1025
+ },
1026
+ {
1027
+ "epoch": 64.99,
1028
+ "eval_accuracy": 0.8848619329388561,
1029
+ "eval_f1": 0.8797631307929968,
1030
+ "eval_loss": 0.3735732436180115,
1031
+ "eval_precision_following": 0.8547727272727272,
1032
+ "eval_precision_not_following": 0.9205280172413793,
1033
+ "eval_recall_following": 0.9272682445759369,
1034
+ "eval_recall_not_following": 0.8424556213017751,
1035
+ "eval_runtime": 6.3558,
1036
+ "eval_samples_per_second": 1276.317,
1037
+ "eval_steps_per_second": 5.035,
1038
+ "step": 10335
1039
+ },
1040
+ {
1041
+ "epoch": 65.99,
1042
+ "eval_accuracy": 0.8846153846153846,
1043
+ "eval_f1": 0.8794746330157095,
1044
+ "eval_loss": 0.3728518784046173,
1045
+ "eval_precision_following": 0.8543843707405725,
1046
+ "eval_precision_not_following": 0.9204851752021563,
1047
+ "eval_recall_following": 0.9272682445759369,
1048
+ "eval_recall_not_following": 0.8419625246548323,
1049
+ "eval_runtime": 6.6517,
1050
+ "eval_samples_per_second": 1219.546,
1051
+ "eval_steps_per_second": 4.811,
1052
+ "step": 10494
1053
+ }
1054
+ ],
1055
+ "max_steps": 11925,
1056
+ "num_train_epochs": 75,
1057
+ "total_flos": 2.5032038197959936e+18,
1058
+ "trial_name": null,
1059
+ "trial_params": null
1060
+ }
model/d1dd8365cbf16ff423f537e2291c61a91c717ed1/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ebb1ce7c8b03949d067cec4b43721c54661232c7c0fa141a4776f97f18c7e07
3
+ size 3195
model/d1dd8365cbf16ff423f537e2291c61a91c717ed1/vocab.txt ADDED
The diff for this file is too large to render. See raw diff
 
model/f1f881389fb38108e623689999ceaaaf398c5e92/config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "bert-base-uncased",
3
+ "architectures": [
4
+ "OwnBertForNextSentencePrediction"
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
+ "initializer_range": 0.02,
13
+ "intermediate_size": 3072,
14
+ "layer_norm_eps": 1e-12,
15
+ "max_position_embeddings": 512,
16
+ "model_type": "bert",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 12,
19
+ "pad_token_id": 0,
20
+ "position_embedding_type": "absolute",
21
+ "torch_dtype": "float32",
22
+ "transformers_version": "4.17.0",
23
+ "type_vocab_size": 2,
24
+ "use_cache": true,
25
+ "vocab_size": 30522
26
+ }
model/f1f881389fb38108e623689999ceaaaf398c5e92/info.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "model": "BERT-NSP-v5",
3
+ "description": "Model trained on DailyDialogue and CommonDialogues. Using [unused1] token to divide sentences in context. Improved training arguments (warmup, smaller learning rate). Using frozen test set to better compare models and therefore trained longer time (about 60 epochs). The model also have bigger classification head (from one layer liner as classical). More info can be found at https://wandb.ai/alquist/next-sentence-prediction/runs/vzpwetvm/overview?workspace=user-petr-lorenc"
4
+ }
model/f1f881389fb38108e623689999ceaaaf398c5e92/meta-info.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"args": [], "kwargs": {"model_package": "models", "model_class": "OwnBertForNextSentencePrediction", "data_root": "/home/lorenpe2/project/data", "data_sources": [["COMMON_DIALOGUES", "common_dialogues/train.json", "common_dialogues/valid_frozen.json", "common_dialogues/test_frozen.json"], ["DAILY_DIALOGUES", "daily_dialogues/dialogues_text.train.txt", "daily_dialogues/dev_frozen.json", "daily_dialogues/test_frozen.json"]], "pretrained_model": "bert-base-uncased", "tokenizer": "bert-base-uncased", "approach": "IGNORE_DUPLICITIES", "special_token": "[unused1]", "learning_rate": 5e-07, "warmup_ratio": 0.1, "freeze_prefinetuning": true, "prefinenuting_epoch": 10, "finetuning_epochs": 75}, "tokenizer_args": {"padding": "max_length", "max_length_ctx": 256, "max_length_res": 40, "truncation": "only_first", "return_tensors": "np", "is_split_into_words": true, "approach": "IGNORE_DUPLICITIES", "special_token": "[unused1]"}}
model/f1f881389fb38108e623689999ceaaaf398c5e92/pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3126eae7cab98cc9068a81e6384ba77facfd1e8dd3cfecc983e2609744d3539a
3
+ size 438871109
model/f1f881389fb38108e623689999ceaaaf398c5e92/special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "additional_special_tokens": ["[unused1]"]}
model/f1f881389fb38108e623689999ceaaaf398c5e92/tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"do_lower_case": true, "do_basic_tokenize": true, "never_split": null, "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "tokenize_chinese_chars": true, "strip_accents": null, "model_max_length": 512, "special_tokens_map_file": null, "name_or_path": "bert-base-uncased", "tokenizer_class": "BertTokenizer"}
model/f1f881389fb38108e623689999ceaaaf398c5e92/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49a0183a62c25be44cbf2f333cf9224204e7fbfe84cd9054d94775d61daa9774
3
+ size 3195
model/f1f881389fb38108e623689999ceaaaf398c5e92/vocab.txt ADDED
The diff for this file is too large to render. See raw diff
 
models.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from torch import nn
2
+ import transformers
3
+ from typing import List
4
+
5
+
6
+ def get_class(_model_package, _model_class):
7
+ mod = __import__(_model_package, fromlist=[_model_class])
8
+ return getattr(mod, _model_class)
9
+
10
+
11
+ class OwnBertOnlyNSPHead(nn.Module):
12
+ def __init__(self, config):
13
+ super().__init__()
14
+ self.seq_relationship = self._build_layer(config.hidden_size, layer_dimensions=[256, 64])
15
+
16
+ def forward(self, pooled_output):
17
+ seq_relationship_score = self.seq_relationship(pooled_output)
18
+ return seq_relationship_score
19
+
20
+ def _build_layer(self, init_size, layer_dimensions: List, activation=nn.ReLU()):
21
+ module_list = []
22
+ _init_size = init_size
23
+ for layer_dimension in layer_dimensions:
24
+ module_list.append(nn.Linear(_init_size, layer_dimension))
25
+ module_list.append(activation)
26
+ _init_size = layer_dimension
27
+
28
+ module_list.append(nn.Linear(_init_size, 2))
29
+ return nn.Sequential(*module_list)
30
+
31
+
32
+ class OwnBertForNextSentencePrediction(transformers.BertForNextSentencePrediction):
33
+ def __init__(self, config):
34
+ super().__init__(config)
35
+
36
+ # reinit cls layer to be more powerful
37
+ self.cls = OwnBertOnlyNSPHead(config)
38
+
39
+ # Initialize weights and apply final processing
40
+ self.post_init()