tdiggelm commited on
Commit
9c84485
1 Parent(s): ef81e7a

Initital import.

Browse files
README.md ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language: en
4
+ tags:
5
+ - generated_from_trainer
6
+ datasets:
7
+ - squad_v2
8
+ model-index:
9
+ - name: albert-base-v2-squad_v2
10
+ results:
11
+ - task:
12
+ name: Question Answering
13
+ type: question-answering
14
+ dataset:
15
+ type: squad_v2 # Required. Example: common_voice. Use dataset id from https://hf.co/datasets
16
+ name: The Stanford Question Answering Dataset
17
+ args: en
18
+ metrics:
19
+ - type: eval_exact
20
+ value: 78.8175
21
+ - type: eval_f1
22
+ value: 81.9984
23
+ - type: eval_HasAns_exact
24
+ value: 75.3374
25
+ - type: eval_HasAns_f1
26
+ value: 81.7083
27
+ - type: eval_NoAns_exact
28
+ value: 82.2876
29
+ - type: eval_NoAns_f1
30
+ value: 82.2876
31
+ ---
32
+
33
+ # albert-base-v2-squad_v2
34
+
35
+ This model is a fine-tuned version of [albert-base-v2](https://huggingface.co/albert-base-v2) on the squad_v2 dataset.
36
+
37
+ ## Model description
38
+
39
+ This model is fine-tuned on the extractive question answering task -- The Stanford Question Answering Dataset -- [SQuAD2.0](https://rajpurkar.github.io/SQuAD-explorer/).
40
+
41
+ For convenience this model is prepared to be used with the frameworks `PyTorch`, `Tensorflow` and `ONNX`.
42
+
43
+ ## Intended uses & limitations
44
+
45
+ This model can handle mismatched question-context pairs. Make sure to specify `handle_impossible_answer=True` when using `QuestionAnsweringPipeline`.
46
+
47
+ __Example usage:__
48
+
49
+ ```python
50
+ >>> from transformers import AutoModelForQuestionAnswering, AutoTokenizer, QuestionAnsweringPipeline
51
+ >>> model = AutoModelForQuestionAnswering.from_pretrained("squirro/albert-base-v2-squad_v2")
52
+ >>> tokenizer = AutoTokenizer.from_pretrained("squirro/albert-base-v2-squad_v2")
53
+ >>> qa_model = QuestionAnsweringPipeline(model, tokenizer)
54
+ >>> qa_model(
55
+ >>> question="What's your name?",
56
+ >>> context="My name is Clara and I live in Berkeley.",
57
+ >>> handle_impossible_answer=True # important!
58
+ >>> )
59
+ {'score': 0.9027367830276489, 'start': 11, 'end': 16, 'answer': 'Clara'}
60
+ ```
61
+
62
+ ## Training and evaluation data
63
+
64
+ Training and evaluation was done on [SQuAD2.0](https://huggingface.co/datasets/squad_v2).
65
+
66
+
67
+ ## Training procedure
68
+
69
+ ### Training hyperparameters
70
+
71
+ The following hyperparameters were used during training:
72
+ - learning_rate: 5e-05
73
+ - train_batch_size: 32
74
+ - eval_batch_size: 8
75
+ - seed: 42
76
+ - distributed_type: tpu
77
+ - num_devices: 8
78
+ - total_train_batch_size: 256
79
+ - total_eval_batch_size: 64
80
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
81
+ - lr_scheduler_type: linear
82
+ - num_epochs: 3.0
83
+
84
+ ### Training results
85
+
86
+ | key | value |
87
+ |:-------------------------|--------------:|
88
+ | epoch | 3 |
89
+ | eval_HasAns_exact | 75.3374 |
90
+ | eval_HasAns_f1 | 81.7083 |
91
+ | eval_HasAns_total | 5928 |
92
+ | eval_NoAns_exact | 82.2876 |
93
+ | eval_NoAns_f1 | 82.2876 |
94
+ | eval_NoAns_total | 5945 |
95
+ | eval_best_exact | 78.8175 |
96
+ | eval_best_exact_thresh | 0 |
97
+ | eval_best_f1 | 81.9984 |
98
+ | eval_best_f1_thresh | 0 |
99
+ | eval_exact | 78.8175 |
100
+ | eval_f1 | 81.9984 |
101
+ | eval_samples | 12171 |
102
+ | eval_total | 11873 |
103
+ | train_loss | 0.775293 |
104
+ | train_runtime | 1402 |
105
+ | train_samples | 131958 |
106
+ | train_samples_per_second | 282.363 |
107
+ | train_steps_per_second | 1.104 |
108
+
109
+ ### Framework versions
110
+
111
+ - Transformers 4.18.0.dev0
112
+ - Pytorch 1.9.0+cu111
113
+ - Datasets 1.18.3
114
+ - Tokenizers 0.11.6
all_results.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 3.0,
3
+ "eval_HasAns_exact": 75.33738191632928,
4
+ "eval_HasAns_f1": 81.70829499095663,
5
+ "eval_HasAns_total": 5928,
6
+ "eval_NoAns_exact": 82.28763666947015,
7
+ "eval_NoAns_f1": 82.28763666947015,
8
+ "eval_NoAns_total": 5945,
9
+ "eval_best_exact": 78.8174850501137,
10
+ "eval_best_exact_thresh": 0.0,
11
+ "eval_best_f1": 81.99838058674217,
12
+ "eval_best_f1_thresh": 0.0,
13
+ "eval_exact": 78.8174850501137,
14
+ "eval_f1": 81.99838058674229,
15
+ "eval_samples": 12171,
16
+ "eval_total": 11873,
17
+ "train_loss": 0.7752933292733915,
18
+ "train_runtime": 1402.0046,
19
+ "train_samples": 131958,
20
+ "train_samples_per_second": 282.363,
21
+ "train_steps_per_second": 1.104
22
+ }
config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "./models/albert-base-v2-squad_v2/",
3
+ "architectures": [
4
+ "AlbertForQuestionAnswering"
5
+ ],
6
+ "attention_probs_dropout_prob": 0,
7
+ "bos_token_id": 2,
8
+ "classifier_dropout_prob": 0.1,
9
+ "down_scale_factor": 1,
10
+ "embedding_size": 128,
11
+ "eos_token_id": 3,
12
+ "gap_size": 0,
13
+ "hidden_act": "gelu_new",
14
+ "hidden_dropout_prob": 0,
15
+ "hidden_size": 768,
16
+ "initializer_range": 0.02,
17
+ "inner_group_num": 1,
18
+ "intermediate_size": 3072,
19
+ "layer_norm_eps": 1e-12,
20
+ "max_position_embeddings": 512,
21
+ "model_type": "albert",
22
+ "net_structure_type": 0,
23
+ "num_attention_heads": 12,
24
+ "num_hidden_groups": 1,
25
+ "num_hidden_layers": 12,
26
+ "num_memory_blocks": 0,
27
+ "pad_token_id": 0,
28
+ "position_embedding_type": "absolute",
29
+ "torch_dtype": "float32",
30
+ "transformers_version": "4.17.0",
31
+ "type_vocab_size": 2,
32
+ "vocab_size": 30000
33
+ }
eval_results.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 3.0,
3
+ "eval_HasAns_exact": 75.33738191632928,
4
+ "eval_HasAns_f1": 81.70829499095663,
5
+ "eval_HasAns_total": 5928,
6
+ "eval_NoAns_exact": 82.28763666947015,
7
+ "eval_NoAns_f1": 82.28763666947015,
8
+ "eval_NoAns_total": 5945,
9
+ "eval_best_exact": 78.8174850501137,
10
+ "eval_best_exact_thresh": 0.0,
11
+ "eval_best_f1": 81.99838058674217,
12
+ "eval_best_f1_thresh": 0.0,
13
+ "eval_exact": 78.8174850501137,
14
+ "eval_f1": 81.99838058674229,
15
+ "eval_samples": 12171,
16
+ "eval_total": 11873
17
+ }
model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:658aad40a3a1a3d70258678bf96c14c11fc730f758e27a2f67220b33f644c627
3
+ size 355875424
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9047ad8b56c90c6a13ed5f747e19434145f503fbea005768815b1af9fa24eef5
3
+ size 44390231
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
1
+ {"bos_token": "[CLS]", "eos_token": "[SEP]", "unk_token": "<unk>", "sep_token": "[SEP]", "pad_token": "<pad>", "cls_token": "[CLS]", "mask_token": {"content": "[MASK]", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false}}
tf_model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4968f90f9953e804e961bdb0c7ef02db917a12eca02f76366a41c553fd3b100c
3
+ size 44417752
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"do_lower_case": true, "remove_space": true, "keep_accents": false, "bos_token": "[CLS]", "eos_token": "[SEP]", "unk_token": "<unk>", "sep_token": "[SEP]", "pad_token": "<pad>", "cls_token": "[CLS]", "mask_token": {"content": "[MASK]", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false, "__type": "AddedToken"}, "model_max_length": 512, "special_tokens_map_file": null, "name_or_path": "albert-base-v2", "tokenizer_class": "AlbertTokenizer"}
train_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 3.0,
3
+ "train_loss": 0.7752933292733915,
4
+ "train_runtime": 1402.0046,
5
+ "train_samples": 131958,
6
+ "train_samples_per_second": 282.363,
7
+ "train_steps_per_second": 1.104
8
+ }
trainer_state.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 3.0,
5
+ "global_step": 1548,
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.97,
12
+ "learning_rate": 3.3850129198966415e-05,
13
+ "loss": 1.1055,
14
+ "step": 500
15
+ },
16
+ {
17
+ "epoch": 1.94,
18
+ "learning_rate": 1.7700258397932818e-05,
19
+ "loss": 0.7112,
20
+ "step": 1000
21
+ },
22
+ {
23
+ "epoch": 2.91,
24
+ "learning_rate": 1.550387596899225e-06,
25
+ "loss": 0.529,
26
+ "step": 1500
27
+ },
28
+ {
29
+ "epoch": 3.0,
30
+ "step": 1548,
31
+ "total_flos": 820457454108672.0,
32
+ "train_loss": 0.7752933292733915,
33
+ "train_runtime": 1402.0046,
34
+ "train_samples_per_second": 282.363,
35
+ "train_steps_per_second": 1.104
36
+ }
37
+ ],
38
+ "max_steps": 1548,
39
+ "num_train_epochs": 3,
40
+ "total_flos": 820457454108672.0,
41
+ "trial_name": null,
42
+ "trial_params": null
43
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5d67a6850c1f3efa60973ae320dd1a905b01971e66bbc29f8ac0409e32b66c9
3
+ size 3055