Instructions to use lekhnathrijal/bert-question-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lekhnathrijal/bert-question-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="lekhnathrijal/bert-question-classifier")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("lekhnathrijal/bert-question-classifier") model = AutoModelForSequenceClassification.from_pretrained("lekhnathrijal/bert-question-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
ai-research-lab/bert-question-classifier
Browse files- README.md +29 -37
- config.json +18 -0
- model.safetensors +1 -1
- tokenizer.json +10 -1
README.md
CHANGED
|
@@ -21,11 +21,11 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 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.
|
| 25 |
-
- Accuracy: 0.
|
| 26 |
-
- Recall: 0.
|
| 27 |
-
- Precision: 0.
|
| 28 |
-
- F1: 0.
|
| 29 |
|
| 30 |
## Model description
|
| 31 |
|
|
@@ -51,43 +51,35 @@ The following hyperparameters were used during training:
|
|
| 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 |
- lr_scheduler_warmup_ratio: 0.1
|
| 54 |
-
- num_epochs:
|
| 55 |
|
| 56 |
### Training results
|
| 57 |
|
| 58 |
| Training Loss | Epoch | Step | Validation Loss | Accuracy | Recall | Precision | F1 |
|
| 59 |
|:-------------:|:------:|:----:|:---------------:|:--------:|:------:|:---------:|:------:|
|
| 60 |
-
| No log | 0.0959 | 100 | 5.
|
| 61 |
-
| No log | 0.1918 | 200 | 5.
|
| 62 |
-
| No log | 0.2876 | 300 | 4.
|
| 63 |
-
| No log | 0.3835 | 400 | 4.
|
| 64 |
-
|
|
| 65 |
-
|
|
| 66 |
-
|
|
| 67 |
-
|
|
| 68 |
-
|
|
| 69 |
-
| 3.
|
| 70 |
-
| 3.
|
| 71 |
-
| 3.
|
| 72 |
-
| 3.
|
| 73 |
-
| 3.
|
| 74 |
-
| 2.
|
| 75 |
-
| 2.
|
| 76 |
-
| 2.
|
| 77 |
-
| 2.
|
| 78 |
-
| 2.
|
| 79 |
-
| 2.
|
| 80 |
-
| 2.
|
| 81 |
-
| 2.
|
| 82 |
-
| 2.
|
| 83 |
-
| 2.2551 | 2.3011 | 2400 | 1.8227 | 0.9684 | 0.8378 | 0.8187 | 0.8281 |
|
| 84 |
-
| 1.8456 | 2.3969 | 2500 | 1.7578 | 0.9699 | 0.8415 | 0.8297 | 0.8355 |
|
| 85 |
-
| 1.8456 | 2.4928 | 2600 | 1.7359 | 0.9703 | 0.8505 | 0.8276 | 0.8389 |
|
| 86 |
-
| 1.8456 | 2.5887 | 2700 | 1.6956 | 0.9704 | 0.8502 | 0.8283 | 0.8391 |
|
| 87 |
-
| 1.8456 | 2.6846 | 2800 | 1.6397 | 0.9711 | 0.8539 | 0.8327 | 0.8432 |
|
| 88 |
-
| 1.8456 | 2.7804 | 2900 | 1.6111 | 0.9727 | 0.8589 | 0.8434 | 0.8511 |
|
| 89 |
-
| 1.5842 | 2.8763 | 3000 | 1.5852 | 0.9726 | 0.8607 | 0.8412 | 0.8508 |
|
| 90 |
-
| 1.5842 | 2.9722 | 3100 | 1.5659 | 0.9723 | 0.8536 | 0.8431 | 0.8483 |
|
| 91 |
|
| 92 |
|
| 93 |
### Framework versions
|
|
|
|
| 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.9349
|
| 25 |
+
- Accuracy: 0.9687
|
| 26 |
+
- Recall: 0.8393
|
| 27 |
+
- Precision: 0.8205
|
| 28 |
+
- F1: 0.8298
|
| 29 |
|
| 30 |
## Model description
|
| 31 |
|
|
|
|
| 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 |
- lr_scheduler_warmup_ratio: 0.1
|
| 54 |
+
- num_epochs: 10
|
| 55 |
|
| 56 |
### Training results
|
| 57 |
|
| 58 |
| Training Loss | Epoch | Step | Validation Loss | Accuracy | Recall | Precision | F1 |
|
| 59 |
|:-------------:|:------:|:----:|:---------------:|:--------:|:------:|:---------:|:------:|
|
| 60 |
+
| No log | 0.0959 | 100 | 5.3220 | 0.8786 | 0.3772 | 0.3462 | 0.3610 |
|
| 61 |
+
| No log | 0.1918 | 200 | 5.1118 | 0.9118 | 0.5105 | 0.5152 | 0.5129 |
|
| 62 |
+
| No log | 0.2876 | 300 | 4.7630 | 0.9237 | 0.5934 | 0.5786 | 0.5859 |
|
| 63 |
+
| No log | 0.3835 | 400 | 4.5162 | 0.9247 | 0.6079 | 0.5821 | 0.5948 |
|
| 64 |
+
| 4.9675 | 0.4794 | 500 | 4.2140 | 0.9288 | 0.6300 | 0.6041 | 0.6168 |
|
| 65 |
+
| 4.9675 | 0.5753 | 600 | 3.9853 | 0.9357 | 0.6694 | 0.6402 | 0.6544 |
|
| 66 |
+
| 4.9675 | 0.6711 | 700 | 3.7985 | 0.9364 | 0.6600 | 0.6476 | 0.6538 |
|
| 67 |
+
| 4.9675 | 0.7670 | 800 | 3.5336 | 0.9426 | 0.7044 | 0.6775 | 0.6907 |
|
| 68 |
+
| 4.9675 | 0.8629 | 900 | 3.3734 | 0.9438 | 0.7094 | 0.6841 | 0.6965 |
|
| 69 |
+
| 3.7188 | 0.9588 | 1000 | 3.1605 | 0.9482 | 0.7326 | 0.7078 | 0.7200 |
|
| 70 |
+
| 3.7188 | 1.0547 | 1100 | 3.0154 | 0.9495 | 0.7317 | 0.7181 | 0.7248 |
|
| 71 |
+
| 3.7188 | 1.1505 | 1200 | 2.8699 | 0.9518 | 0.7478 | 0.7293 | 0.7384 |
|
| 72 |
+
| 3.7188 | 1.2464 | 1300 | 2.7020 | 0.9540 | 0.7605 | 0.7406 | 0.7504 |
|
| 73 |
+
| 3.7188 | 1.3423 | 1400 | 2.5487 | 0.9587 | 0.7863 | 0.7654 | 0.7757 |
|
| 74 |
+
| 2.8304 | 1.4382 | 1500 | 2.4370 | 0.9609 | 0.8027 | 0.7749 | 0.7885 |
|
| 75 |
+
| 2.8304 | 1.5340 | 1600 | 2.3423 | 0.9625 | 0.8043 | 0.7874 | 0.7958 |
|
| 76 |
+
| 2.8304 | 1.6299 | 1700 | 2.2367 | 0.9637 | 0.8117 | 0.7940 | 0.8028 |
|
| 77 |
+
| 2.8304 | 1.7258 | 1800 | 2.1771 | 0.9652 | 0.8154 | 0.8045 | 0.8099 |
|
| 78 |
+
| 2.8304 | 1.8217 | 1900 | 2.0955 | 0.9655 | 0.8248 | 0.8019 | 0.8131 |
|
| 79 |
+
| 2.2139 | 1.9175 | 2000 | 2.0031 | 0.9676 | 0.8316 | 0.8159 | 0.8237 |
|
| 80 |
+
| 2.2139 | 2.0134 | 2100 | 1.9349 | 0.9687 | 0.8393 | 0.8205 | 0.8298 |
|
| 81 |
+
| 2.2139 | 2.1093 | 2200 | 1.8722 | 0.9683 | 0.8344 | 0.8201 | 0.8272 |
|
| 82 |
+
| 2.2139 | 2.2052 | 2300 | 1.8385 | 0.9682 | 0.8396 | 0.8161 | 0.8277 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
|
| 85 |
### Framework versions
|
config.json
CHANGED
|
@@ -5,6 +5,24 @@
|
|
| 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,
|
|
|
|
| 5 |
],
|
| 6 |
"attention_probs_dropout_prob": 0.1,
|
| 7 |
"classifier_dropout": null,
|
| 8 |
+
"custom_pipelines": {
|
| 9 |
+
"question-classifier": {
|
| 10 |
+
"default": {
|
| 11 |
+
"model": {
|
| 12 |
+
"pt": [
|
| 13 |
+
"ai-research-lab/bert-question-classifier",
|
| 14 |
+
"main"
|
| 15 |
+
]
|
| 16 |
+
}
|
| 17 |
+
},
|
| 18 |
+
"impl": "classifier_pipeline.MultiTaskClassifierPipeline",
|
| 19 |
+
"pt": [
|
| 20 |
+
"AutoModelForSequenceClassification"
|
| 21 |
+
],
|
| 22 |
+
"tf": [],
|
| 23 |
+
"type": "text"
|
| 24 |
+
}
|
| 25 |
+
},
|
| 26 |
"gradient_checkpointing": false,
|
| 27 |
"hidden_act": "gelu",
|
| 28 |
"hidden_dropout_prob": 0.1,
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 438057080
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a57f19aad1305b29947aa312b1f7dbdd6b9a9a5c6a139891711ae14d2ec3139b
|
| 3 |
size 438057080
|
tokenizer.json
CHANGED
|
@@ -6,7 +6,16 @@
|
|
| 6 |
"strategy": "LongestFirst",
|
| 7 |
"stride": 0
|
| 8 |
},
|
| 9 |
-
"padding":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
"added_tokens": [
|
| 11 |
{
|
| 12 |
"id": 0,
|
|
|
|
| 6 |
"strategy": "LongestFirst",
|
| 7 |
"stride": 0
|
| 8 |
},
|
| 9 |
+
"padding": {
|
| 10 |
+
"strategy": {
|
| 11 |
+
"Fixed": 512
|
| 12 |
+
},
|
| 13 |
+
"direction": "Right",
|
| 14 |
+
"pad_to_multiple_of": null,
|
| 15 |
+
"pad_id": 0,
|
| 16 |
+
"pad_type_id": 0,
|
| 17 |
+
"pad_token": "[PAD]"
|
| 18 |
+
},
|
| 19 |
"added_tokens": [
|
| 20 |
{
|
| 21 |
"id": 0,
|