Luna-Skywalker commited on
Commit
b9a9ae1
·
verified ·
1 Parent(s): 78c5b7e

BERT-crime-analysis

Browse files
README.md ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: google-bert/bert-base-uncased
4
+ tags:
5
+ - generated_from_trainer
6
+ metrics:
7
+ - accuracy
8
+ model-index:
9
+ - name: results
10
+ results: []
11
+ ---
12
+
13
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
14
+ should probably proofread and complete it, then remove this comment. -->
15
+
16
+ # results
17
+
18
+ This model is a fine-tuned version of [google-bert/bert-base-uncased](https://huggingface.co/google-bert/bert-base-uncased) on the None dataset.
19
+ It achieves the following results on the evaluation set:
20
+ - Loss: 0.1241
21
+ - Macro f1: 0.8944
22
+ - Weighted f1: 0.9315
23
+ - Accuracy: 0.9380
24
+ - Balanced accuracy: 0.9042
25
+
26
+ ## Model description
27
+
28
+ More information needed
29
+
30
+ ## Intended uses & limitations
31
+
32
+ More information needed
33
+
34
+ ## Training and evaluation data
35
+
36
+ More information needed
37
+
38
+ ## Training procedure
39
+
40
+ ### Training hyperparameters
41
+
42
+ The following hyperparameters were used during training:
43
+ - learning_rate: 5e-05
44
+ - train_batch_size: 32
45
+ - eval_batch_size: 32
46
+ - seed: 42
47
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
48
+ - lr_scheduler_type: linear
49
+ - num_epochs: 30
50
+
51
+ ### Training results
52
+
53
+ | Training Loss | Epoch | Step | Validation Loss | Macro f1 | Weighted f1 | Accuracy | Balanced accuracy |
54
+ |:-------------:|:-----:|:------:|:---------------:|:--------:|:-----------:|:--------:|:-----------------:|
55
+ | 0.1859 | 1.0 | 5538 | 0.1297 | 0.8561 | 0.9249 | 0.9366 | 0.8571 |
56
+ | 0.1281 | 2.0 | 11076 | 0.1260 | 0.8702 | 0.9248 | 0.9369 | 0.8740 |
57
+ | 0.1279 | 3.0 | 16614 | 0.1251 | 0.8728 | 0.9314 | 0.9380 | 0.8749 |
58
+ | 0.1272 | 4.0 | 22152 | 0.1276 | 0.8652 | 0.9247 | 0.9367 | 0.8655 |
59
+ | 0.1266 | 5.0 | 27690 | 0.1256 | 0.8685 | 0.9252 | 0.9345 | 0.8724 |
60
+ | 0.1284 | 6.0 | 33228 | 0.1264 | 0.8668 | 0.9252 | 0.9345 | 0.8724 |
61
+ | 0.1272 | 7.0 | 38766 | 0.1247 | 0.8739 | 0.9313 | 0.9379 | 0.8748 |
62
+ | 0.1262 | 8.0 | 44304 | 0.1258 | 0.8892 | 0.9246 | 0.9366 | 0.9024 |
63
+ | 0.1263 | 9.0 | 49842 | 0.1251 | 0.9038 | 0.9310 | 0.9378 | 0.9041 |
64
+ | 0.1267 | 10.0 | 55380 | 0.1244 | 0.8897 | 0.9253 | 0.9345 | 0.9018 |
65
+ | 0.1271 | 11.0 | 60918 | 0.1251 | 0.8951 | 0.9325 | 0.9371 | 0.9036 |
66
+ | 0.1268 | 12.0 | 66456 | 0.1248 | 0.8944 | 0.9315 | 0.9380 | 0.9042 |
67
+ | 0.1254 | 13.0 | 71994 | 0.1247 | 0.9038 | 0.9314 | 0.9381 | 0.9043 |
68
+ | 0.126 | 14.0 | 77532 | 0.1263 | 0.8944 | 0.9314 | 0.9379 | 0.9042 |
69
+ | 0.1261 | 15.0 | 83070 | 0.1274 | 0.8891 | 0.9250 | 0.9348 | 0.9020 |
70
+ | 0.1253 | 16.0 | 88608 | 0.1241 | 0.8944 | 0.9315 | 0.9380 | 0.9042 |
71
+ | 0.1251 | 17.0 | 94146 | 0.1244 | 0.9042 | 0.9314 | 0.9380 | 0.9042 |
72
+ | 0.125 | 18.0 | 99684 | 0.1249 | 0.9041 | 0.9314 | 0.9380 | 0.9043 |
73
+ | 0.125 | 19.0 | 105222 | 0.1245 | 0.8942 | 0.9312 | 0.9380 | 0.9042 |
74
+ | 0.1257 | 20.0 | 110760 | 0.1248 | 0.9041 | 0.9313 | 0.9379 | 0.9042 |
75
+ | 0.125 | 21.0 | 116298 | 0.1248 | 0.9000 | 0.9254 | 0.9344 | 0.9018 |
76
+ | 0.1248 | 22.0 | 121836 | 0.1244 | 0.9041 | 0.9313 | 0.9379 | 0.9042 |
77
+ | 0.1246 | 23.0 | 127374 | 0.1245 | 0.9042 | 0.9315 | 0.9380 | 0.9042 |
78
+ | 0.1247 | 24.0 | 132912 | 0.1242 | 0.8943 | 0.9314 | 0.9380 | 0.9043 |
79
+ | 0.1245 | 25.0 | 138450 | 0.1242 | 0.9042 | 0.9315 | 0.9380 | 0.9042 |
80
+ | 0.1245 | 26.0 | 143988 | 0.1245 | 0.9042 | 0.9314 | 0.9381 | 0.9043 |
81
+ | 0.1245 | 27.0 | 149526 | 0.1242 | 0.8944 | 0.9314 | 0.9381 | 0.9043 |
82
+ | 0.1244 | 28.0 | 155064 | 0.1242 | 0.9336 | 0.9315 | 0.9381 | 0.9337 |
83
+ | 0.1243 | 29.0 | 160602 | 0.1243 | 0.8944 | 0.9314 | 0.9381 | 0.9043 |
84
+ | 0.1243 | 30.0 | 166140 | 0.1243 | 0.8944 | 0.9314 | 0.9381 | 0.9043 |
85
+
86
+
87
+ ### Framework versions
88
+
89
+ - Transformers 4.39.3
90
+ - Pytorch 2.2.2
91
+ - Datasets 2.18.0
92
+ - Tokenizers 0.15.2
config.json ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "google-bert/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": "ARSON",
14
+ "1": "ASSAULT",
15
+ "2": "BATTERY",
16
+ "3": "BURGLARY",
17
+ "4": "CONCEALED CARRY LICENSE VIOLATION",
18
+ "5": "CRIM SEXUAL ASSAULT",
19
+ "6": "CRIMINAL DAMAGE",
20
+ "7": "CRIMINAL TRESPASS",
21
+ "8": "DECEPTIVE PRACTICE",
22
+ "9": "DOMESTIC VIOLENCE",
23
+ "10": "GAMBLING",
24
+ "11": "HOMICIDE",
25
+ "12": "HUMAN TRAFFICKING",
26
+ "13": "INTERFERENCE WITH PUBLIC OFFICER",
27
+ "14": "INTIMIDATION",
28
+ "15": "KIDNAPPING",
29
+ "16": "LIQUOR LAW VIOLATION",
30
+ "17": "MOTOR VEHICLE THEFT",
31
+ "18": "NARCOTICS",
32
+ "19": "NON-CRIMINAL",
33
+ "20": "NON-CRIMINAL (SUBJECT SPECIFIED)",
34
+ "21": "OBSCENITY",
35
+ "22": "OFFENSE INVOLVING CHILDREN",
36
+ "23": "OTHER NARCOTIC VIOLATION",
37
+ "24": "OTHER OFFENSE",
38
+ "25": "PROSTITUTION",
39
+ "26": "PUBLIC INDECENCY",
40
+ "27": "PUBLIC PEACE VIOLATION",
41
+ "28": "RITUALISM",
42
+ "29": "ROBBERY",
43
+ "30": "SEX OFFENSE",
44
+ "31": "STALKING",
45
+ "32": "THEFT",
46
+ "33": "WEAPONS VIOLATION"
47
+ },
48
+ "initializer_range": 0.02,
49
+ "intermediate_size": 3072,
50
+ "label2id": {
51
+ "ARSON": 0,
52
+ "ASSAULT": 1,
53
+ "BATTERY": 2,
54
+ "BURGLARY": 3,
55
+ "CONCEALED CARRY LICENSE VIOLATION": 4,
56
+ "CRIM SEXUAL ASSAULT": 5,
57
+ "CRIMINAL DAMAGE": 6,
58
+ "CRIMINAL TRESPASS": 7,
59
+ "DECEPTIVE PRACTICE": 8,
60
+ "DOMESTIC VIOLENCE": 9,
61
+ "GAMBLING": 10,
62
+ "HOMICIDE": 11,
63
+ "HUMAN TRAFFICKING": 12,
64
+ "INTERFERENCE WITH PUBLIC OFFICER": 13,
65
+ "INTIMIDATION": 14,
66
+ "KIDNAPPING": 15,
67
+ "LIQUOR LAW VIOLATION": 16,
68
+ "MOTOR VEHICLE THEFT": 17,
69
+ "NARCOTICS": 18,
70
+ "NON-CRIMINAL": 19,
71
+ "NON-CRIMINAL (SUBJECT SPECIFIED)": 20,
72
+ "OBSCENITY": 21,
73
+ "OFFENSE INVOLVING CHILDREN": 22,
74
+ "OTHER NARCOTIC VIOLATION": 23,
75
+ "OTHER OFFENSE": 24,
76
+ "PROSTITUTION": 25,
77
+ "PUBLIC INDECENCY": 26,
78
+ "PUBLIC PEACE VIOLATION": 27,
79
+ "RITUALISM": 28,
80
+ "ROBBERY": 29,
81
+ "SEX OFFENSE": 30,
82
+ "STALKING": 31,
83
+ "THEFT": 32,
84
+ "WEAPONS VIOLATION": 33
85
+ },
86
+ "layer_norm_eps": 1e-12,
87
+ "max_position_embeddings": 512,
88
+ "model_type": "bert",
89
+ "num_attention_heads": 12,
90
+ "num_hidden_layers": 12,
91
+ "pad_token_id": 0,
92
+ "position_embedding_type": "absolute",
93
+ "problem_type": "single_label_classification",
94
+ "torch_dtype": "float32",
95
+ "transformers_version": "4.39.3",
96
+ "type_vocab_size": 2,
97
+ "use_cache": true,
98
+ "vocab_size": 30522
99
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4cf01dcebeb8260213d2648b5fc532c77bd5ad74689da1280c43cebc06c838c
3
+ size 438057080
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:f55db632f996074ad22675fe3d18994b78d082ad14e33de18dbe17da52c452a4
3
+ size 4856
vocab.txt ADDED
The diff for this file is too large to render. See raw diff