ai-research-lab/bert-question-classifier
Browse files- README.md +67 -0
- config.json +180 -0
- model.safetensors +3 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +57 -0
- training_args.bin +3 -0
- vocab.txt +0 -0
README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: google-bert/bert-base-uncased
|
| 5 |
+
tags:
|
| 6 |
+
- generated_from_trainer
|
| 7 |
+
metrics:
|
| 8 |
+
- accuracy
|
| 9 |
+
- recall
|
| 10 |
+
- precision
|
| 11 |
+
- f1
|
| 12 |
+
model-index:
|
| 13 |
+
- name: bert-question-classifier
|
| 14 |
+
results: []
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 18 |
+
should probably proofread and complete it, then remove this comment. -->
|
| 19 |
+
|
| 20 |
+
# bert-question-classifier
|
| 21 |
+
|
| 22 |
+
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.
|
| 23 |
+
It achieves the following results on the evaluation set:
|
| 24 |
+
- Loss: 1.9599
|
| 25 |
+
- Accuracy: 0.9332
|
| 26 |
+
- Recall: 0.8139
|
| 27 |
+
- Precision: 0.8199
|
| 28 |
+
- F1: 0.8169
|
| 29 |
+
|
| 30 |
+
## Model description
|
| 31 |
+
|
| 32 |
+
More information needed
|
| 33 |
+
|
| 34 |
+
## Intended uses & limitations
|
| 35 |
+
|
| 36 |
+
More information needed
|
| 37 |
+
|
| 38 |
+
## Training and evaluation data
|
| 39 |
+
|
| 40 |
+
More information needed
|
| 41 |
+
|
| 42 |
+
## Training procedure
|
| 43 |
+
|
| 44 |
+
### Training hyperparameters
|
| 45 |
+
|
| 46 |
+
The following hyperparameters were used during training:
|
| 47 |
+
- learning_rate: 2e-05
|
| 48 |
+
- train_batch_size: 8
|
| 49 |
+
- eval_batch_size: 8
|
| 50 |
+
- seed: 42
|
| 51 |
+
- optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 52 |
+
- lr_scheduler_type: linear
|
| 53 |
+
- num_epochs: 1
|
| 54 |
+
|
| 55 |
+
### Training results
|
| 56 |
+
|
| 57 |
+
| Training Loss | Epoch | Step | Validation Loss | Accuracy | Recall | Precision | F1 |
|
| 58 |
+
|:-------------:|:-----:|:----:|:---------------:|:--------:|:------:|:---------:|:------:|
|
| 59 |
+
| No log | 1.0 | 390 | 1.9599 | 0.9332 | 0.8139 | 0.8199 | 0.8169 |
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
### Framework versions
|
| 63 |
+
|
| 64 |
+
- Transformers 4.47.1
|
| 65 |
+
- Pytorch 2.5.1
|
| 66 |
+
- Datasets 3.2.0
|
| 67 |
+
- Tokenizers 0.21.0
|
config.json
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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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": "d",
|
| 14 |
+
"1": "y",
|
| 15 |
+
"2": "c",
|
| 16 |
+
"3": "o",
|
| 17 |
+
"4": "career",
|
| 18 |
+
"5": "family",
|
| 19 |
+
"6": "marriage",
|
| 20 |
+
"7": "love",
|
| 21 |
+
"8": "self",
|
| 22 |
+
"9": "education",
|
| 23 |
+
"10": "wealth",
|
| 24 |
+
"11": "business",
|
| 25 |
+
"12": "hard times",
|
| 26 |
+
"13": "health",
|
| 27 |
+
"14": "spirituality",
|
| 28 |
+
"15": "others",
|
| 29 |
+
"16": "time_based",
|
| 30 |
+
"17": "positive_perception"
|
| 31 |
+
},
|
| 32 |
+
"initializer_range": 0.02,
|
| 33 |
+
"intermediate_size": 3072,
|
| 34 |
+
"label2id": {
|
| 35 |
+
"business": 11,
|
| 36 |
+
"c": 2,
|
| 37 |
+
"career": 4,
|
| 38 |
+
"d": 0,
|
| 39 |
+
"education": 9,
|
| 40 |
+
"family": 5,
|
| 41 |
+
"hard times": 12,
|
| 42 |
+
"health": 13,
|
| 43 |
+
"love": 7,
|
| 44 |
+
"marriage": 6,
|
| 45 |
+
"o": 3,
|
| 46 |
+
"others": 15,
|
| 47 |
+
"positive_perception": 17,
|
| 48 |
+
"self": 8,
|
| 49 |
+
"spirituality": 14,
|
| 50 |
+
"time_based": 16,
|
| 51 |
+
"wealth": 10,
|
| 52 |
+
"y": 1
|
| 53 |
+
},
|
| 54 |
+
"layer_norm_eps": 1e-12,
|
| 55 |
+
"max_position_embeddings": 512,
|
| 56 |
+
"model_type": "bert",
|
| 57 |
+
"num_attention_heads": 12,
|
| 58 |
+
"num_hidden_layers": 12,
|
| 59 |
+
"pad_token_id": 0,
|
| 60 |
+
"position_embedding_type": "absolute",
|
| 61 |
+
"task_specific_params": {
|
| 62 |
+
"classifier_config": {
|
| 63 |
+
"multi_class": [
|
| 64 |
+
{
|
| 65 |
+
"column": "question type",
|
| 66 |
+
"labels": [
|
| 67 |
+
[
|
| 68 |
+
"d",
|
| 69 |
+
"Descriptive"
|
| 70 |
+
],
|
| 71 |
+
[
|
| 72 |
+
"y",
|
| 73 |
+
"Yes/No"
|
| 74 |
+
],
|
| 75 |
+
[
|
| 76 |
+
"c",
|
| 77 |
+
"Complex"
|
| 78 |
+
],
|
| 79 |
+
[
|
| 80 |
+
"o",
|
| 81 |
+
"Options"
|
| 82 |
+
]
|
| 83 |
+
],
|
| 84 |
+
"loss_weight": 1,
|
| 85 |
+
"name": "type"
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"column": "category",
|
| 89 |
+
"labels": [
|
| 90 |
+
[
|
| 91 |
+
"career",
|
| 92 |
+
"Career"
|
| 93 |
+
],
|
| 94 |
+
[
|
| 95 |
+
"family",
|
| 96 |
+
"Family"
|
| 97 |
+
],
|
| 98 |
+
[
|
| 99 |
+
"marriage",
|
| 100 |
+
"Marriage"
|
| 101 |
+
],
|
| 102 |
+
[
|
| 103 |
+
"love",
|
| 104 |
+
"Love"
|
| 105 |
+
],
|
| 106 |
+
[
|
| 107 |
+
"self",
|
| 108 |
+
"Self"
|
| 109 |
+
],
|
| 110 |
+
[
|
| 111 |
+
"education",
|
| 112 |
+
"Education"
|
| 113 |
+
],
|
| 114 |
+
[
|
| 115 |
+
"wealth",
|
| 116 |
+
"Wealth"
|
| 117 |
+
],
|
| 118 |
+
[
|
| 119 |
+
"business",
|
| 120 |
+
"Business"
|
| 121 |
+
],
|
| 122 |
+
[
|
| 123 |
+
"hard times",
|
| 124 |
+
"Hard Times"
|
| 125 |
+
],
|
| 126 |
+
[
|
| 127 |
+
"health",
|
| 128 |
+
"Health"
|
| 129 |
+
],
|
| 130 |
+
[
|
| 131 |
+
"spirituality",
|
| 132 |
+
"Spirituality"
|
| 133 |
+
],
|
| 134 |
+
[
|
| 135 |
+
"others",
|
| 136 |
+
"Others"
|
| 137 |
+
]
|
| 138 |
+
],
|
| 139 |
+
"loss_weight": 1,
|
| 140 |
+
"name": "category"
|
| 141 |
+
}
|
| 142 |
+
],
|
| 143 |
+
"multi_label": [
|
| 144 |
+
{
|
| 145 |
+
"columns": {
|
| 146 |
+
"perception": {
|
| 147 |
+
"n": 0,
|
| 148 |
+
"p": 1,
|
| 149 |
+
"y": 1
|
| 150 |
+
},
|
| 151 |
+
"time based": {
|
| 152 |
+
"n": 0,
|
| 153 |
+
"p": 1,
|
| 154 |
+
"y": 1
|
| 155 |
+
}
|
| 156 |
+
},
|
| 157 |
+
"labels": [
|
| 158 |
+
[
|
| 159 |
+
"time_based",
|
| 160 |
+
"Time Based"
|
| 161 |
+
],
|
| 162 |
+
[
|
| 163 |
+
"positive_perception",
|
| 164 |
+
"Positive Perception"
|
| 165 |
+
]
|
| 166 |
+
],
|
| 167 |
+
"loss_weight": 1,
|
| 168 |
+
"name": "attributes",
|
| 169 |
+
"threshold": 0
|
| 170 |
+
}
|
| 171 |
+
]
|
| 172 |
+
},
|
| 173 |
+
"random": "marimo notebook run 1"
|
| 174 |
+
},
|
| 175 |
+
"torch_dtype": "float32",
|
| 176 |
+
"transformers_version": "4.47.1",
|
| 177 |
+
"type_vocab_size": 2,
|
| 178 |
+
"use_cache": true,
|
| 179 |
+
"vocab_size": 30522
|
| 180 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:918408f849c0cf877a7848a1a75c08f56b4d17e6b120286d01058d04595c1cc0
|
| 3 |
+
size 438007864
|
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,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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": false,
|
| 45 |
+
"cls_token": "[CLS]",
|
| 46 |
+
"do_lower_case": true,
|
| 47 |
+
"extra_special_tokens": {},
|
| 48 |
+
"mask_token": "[MASK]",
|
| 49 |
+
"max_length": 512,
|
| 50 |
+
"model_max_length": 512,
|
| 51 |
+
"pad_token": "[PAD]",
|
| 52 |
+
"sep_token": "[SEP]",
|
| 53 |
+
"strip_accents": null,
|
| 54 |
+
"tokenize_chinese_chars": true,
|
| 55 |
+
"tokenizer_class": "BertTokenizer",
|
| 56 |
+
"unk_token": "[UNK]"
|
| 57 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3e6e4febefdcf1abcdc88065ebac690bee3db2bb7fc5aafa5d82952e12cd68b1
|
| 3 |
+
size 5368
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|