MattStammers commited on
Commit
b6da0f4
·
1 Parent(s): 6a88e6d

ONNX Covid 19 model

Browse files
Files changed (7) hide show
  1. README.md +17 -0
  2. config.json +26 -0
  3. model.onnx +3 -0
  4. optimizer.pt +3 -0
  5. rng_state.pth +3 -0
  6. trainer_state.json +125 -0
  7. training_args.bin +3 -0
README.md CHANGED
@@ -1,3 +1,20 @@
1
  ---
2
  license: mit
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
  ---
4
+ This is a basic inference BERT model which has been fine-tuned to discriminate between covid19 and non-covid-19 relevant texts.
5
+
6
+ Unlike past models I have created this one raw and uploaded it as a standalone git repo to experiment with upload options. Not as streamlined as using the Huggingface card generation system but definitely simpler to do.
7
+
8
+ This is also my first experiment with ONNX.
9
+
10
+ - The dataset came from Thiago Martins: https://github.com/thigm85
11
+
12
+ Training data can be obtained as follows:
13
+ ```python
14
+ import pandas as pd
15
+
16
+ training_data = pd.read_csv("https://thigm85.github.io/data/cord19/cord19-query-title-label.csv")
17
+ training_data.head()
18
+ ```
19
+
20
+ Enjoy!
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "google/bert_uncased_L-4_H-512_A-8",
3
+ "architectures": [
4
+ "BertForSequenceClassification"
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": 512,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 2048,
13
+ "layer_norm_eps": 1e-12,
14
+ "max_position_embeddings": 512,
15
+ "model_type": "bert",
16
+ "num_attention_heads": 8,
17
+ "num_hidden_layers": 4,
18
+ "pad_token_id": 0,
19
+ "position_embedding_type": "absolute",
20
+ "problem_type": "single_label_classification",
21
+ "torch_dtype": "float32",
22
+ "transformers_version": "4.34.0",
23
+ "type_vocab_size": 2,
24
+ "use_cache": true,
25
+ "vocab_size": 30522
26
+ }
model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:304128df28249f5608aba2dfa15651ef81565803e568242811fd47a3c841fef7
3
+ size 116639055
optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:026538e139cfbacd1f794b0198531f98129c67c516d8ca30cffc15fcc231b627
3
+ size 10599
rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:061f4fbaefb1d4f27358e6ffb5061f83fdc82fc415eb4c8d60efe730c86df682
3
+ size 14575
trainer_state.json ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 2.9182879377431905,
5
+ "eval_steps": 500,
6
+ "global_step": 7500,
7
+ "is_hyper_param_search": false,
8
+ "is_local_process_zero": true,
9
+ "is_world_process_zero": true,
10
+ "log_history": [
11
+ {
12
+ "epoch": 0.19,
13
+ "learning_rate": 5e-05,
14
+ "loss": 0.6919,
15
+ "step": 500
16
+ },
17
+ {
18
+ "epoch": 0.39,
19
+ "learning_rate": 4.6532593619972264e-05,
20
+ "loss": 0.6696,
21
+ "step": 1000
22
+ },
23
+ {
24
+ "epoch": 0.58,
25
+ "learning_rate": 4.306518723994452e-05,
26
+ "loss": 0.657,
27
+ "step": 1500
28
+ },
29
+ {
30
+ "epoch": 0.78,
31
+ "learning_rate": 3.959778085991678e-05,
32
+ "loss": 0.6521,
33
+ "step": 2000
34
+ },
35
+ {
36
+ "epoch": 0.97,
37
+ "learning_rate": 3.613037447988905e-05,
38
+ "loss": 0.6467,
39
+ "step": 2500
40
+ },
41
+ {
42
+ "epoch": 1.0,
43
+ "eval_loss": 0.6400363445281982,
44
+ "eval_runtime": 33.0485,
45
+ "eval_samples_per_second": 311.027,
46
+ "eval_steps_per_second": 4.872,
47
+ "step": 2570
48
+ },
49
+ {
50
+ "epoch": 1.17,
51
+ "learning_rate": 3.266296809986131e-05,
52
+ "loss": 0.6455,
53
+ "step": 3000
54
+ },
55
+ {
56
+ "epoch": 1.36,
57
+ "learning_rate": 2.9195561719833564e-05,
58
+ "loss": 0.6361,
59
+ "step": 3500
60
+ },
61
+ {
62
+ "epoch": 1.56,
63
+ "learning_rate": 2.5728155339805826e-05,
64
+ "loss": 0.6448,
65
+ "step": 4000
66
+ },
67
+ {
68
+ "epoch": 1.75,
69
+ "learning_rate": 2.2260748959778087e-05,
70
+ "loss": 0.6413,
71
+ "step": 4500
72
+ },
73
+ {
74
+ "epoch": 1.95,
75
+ "learning_rate": 1.879334257975035e-05,
76
+ "loss": 0.641,
77
+ "step": 5000
78
+ },
79
+ {
80
+ "epoch": 2.0,
81
+ "eval_loss": 0.6325713992118835,
82
+ "eval_runtime": 33.21,
83
+ "eval_samples_per_second": 309.515,
84
+ "eval_steps_per_second": 4.848,
85
+ "step": 5140
86
+ },
87
+ {
88
+ "epoch": 2.14,
89
+ "learning_rate": 1.5325936199722607e-05,
90
+ "loss": 0.64,
91
+ "step": 5500
92
+ },
93
+ {
94
+ "epoch": 2.33,
95
+ "learning_rate": 1.1858529819694868e-05,
96
+ "loss": 0.6391,
97
+ "step": 6000
98
+ },
99
+ {
100
+ "epoch": 2.53,
101
+ "learning_rate": 8.39112343966713e-06,
102
+ "loss": 0.6442,
103
+ "step": 6500
104
+ },
105
+ {
106
+ "epoch": 2.72,
107
+ "learning_rate": 4.92371705963939e-06,
108
+ "loss": 0.6312,
109
+ "step": 7000
110
+ },
111
+ {
112
+ "epoch": 2.92,
113
+ "learning_rate": 1.4563106796116506e-06,
114
+ "loss": 0.6375,
115
+ "step": 7500
116
+ }
117
+ ],
118
+ "logging_steps": 500,
119
+ "max_steps": 7710,
120
+ "num_train_epochs": 3,
121
+ "save_steps": 500,
122
+ "total_flos": 1186351718870016.0,
123
+ "trial_name": null,
124
+ "trial_params": null
125
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a376d2cae4c0f66886c32d18817d01dd4d18dc16f5450867a1fa144d623eb3b5
3
+ size 4027