p208p2002 commited on
Commit
78cbc66
1 Parent(s): 0432073
README.md ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Transformer QG on SQuAD
2
+ The inputs of the model refers to
3
+ ```
4
+ we integrate C and A into a new C' in the following form.
5
+ C' = [c1, c2, ..., [HL], a1, ..., a|A|, [HL], ..., c|C|]
6
+ ```
7
+ > Proposed by [Ying-Hong Chan & Yao-Chung Fan. (2019). A Re-current BERT-based Model for Question Generation.](https://www.aclweb.org/anthology/D19-5821/)
8
+
9
+ More detail: [p208p2002/Transformer-QG-on-SQuAD](https://github.com/p208p2002/Transformer-QG-on-SQuAD)
10
+
11
+ ## Features
12
+ - Fully pipline from fine-tune to evaluation
13
+ - Support most of state of the art models
14
+ - Fast deploy as a API server
15
+
16
+ ## Data setting
17
+ We report two dataset setting as Follow
18
+
19
+ ### SQuAD
20
+ - train: 87599
21
+ - validation: 10570
22
+ > [SQuAD: 100,000+ Questions for Machine Comprehension of Text](https://arxiv.org/abs/1606.05250)
23
+
24
+ ### SQuAD NQG
25
+ - train: 75722
26
+ - dev: 10570
27
+ - test: 11877
28
+ > [Learning to Ask: Neural Question Generation for Reading Comprehension](https://arxiv.org/abs/1705.00106)
29
+
30
+ ## Available models
31
+ - BART
32
+ - GPT2
33
+ - T5
34
+
35
+ ## Expriments
36
+ We report score with `NQG Scorer` which is using in SQuAD NQG.
37
+
38
+ If not special explanation, the size of the model defaults to "base".
39
+
40
+ ### SQuAD
41
+ Model |Bleu 1|Bleu 2|Bleu 3|Bleu 4|METEOR|ROUGE-L|
42
+ ---------------------------------|------|------|------|------|------|-------|
43
+ BART-HLSQG |54.67 |39.26 |30.34 |24.15 |25.43 |52.64 |
44
+ GPT2-HLSQG |49.31 |33.95 |25.41| 19.69 |22.29 |48.82 |
45
+ T5-HLSQG |54.29 |39.22 |30.43 |24.26 |25.56 |53.11 |
46
+
47
+ ### SQuAD NQG
48
+ Model |Bleu 1|Bleu 2|Bleu 3|Bleu 4|METEOR|ROUGE-L|
49
+ ---------------------------------|------|------|------|------|------|-------|
50
+ BERT-HLSQG (Chan et al.) |49.73 |34.60 |26.13 |20.33 |23.88 |48.23 |
51
+ BART-HLSQG |54.12 |38.19 |28.84 |22.35 |24.55 |51.03 |
52
+ GPT2-HLSQG |49.82 |33.69 |24.71 |18.63 |21.90 |47.60 |
53
+ T5-HLSQG |53.13 |37.60 |28.62 |22.38 |24.48 |51.20 |
added_tokens.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"[HL]": 50265}
config.json ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "facebook/bart-base",
3
+ "activation_dropout": 0.1,
4
+ "activation_function": "gelu",
5
+ "add_bias_logits": false,
6
+ "add_final_layer_norm": false,
7
+ "architectures": [
8
+ "BartForConditionalGeneration"
9
+ ],
10
+ "attention_dropout": 0.1,
11
+ "bos_token_id": 0,
12
+ "classif_dropout": 0.1,
13
+ "classifier_dropout": 0.0,
14
+ "d_model": 768,
15
+ "decoder_attention_heads": 12,
16
+ "decoder_ffn_dim": 3072,
17
+ "decoder_layerdrop": 0.0,
18
+ "decoder_layers": 6,
19
+ "decoder_start_token_id": 2,
20
+ "dropout": 0.1,
21
+ "early_stopping": true,
22
+ "encoder_attention_heads": 12,
23
+ "encoder_ffn_dim": 3072,
24
+ "encoder_layerdrop": 0.0,
25
+ "encoder_layers": 6,
26
+ "eos_token_id": 2,
27
+ "forced_eos_token_id": 2,
28
+ "gradient_checkpointing": false,
29
+ "id2label": {
30
+ "0": "LABEL_0",
31
+ "1": "LABEL_1",
32
+ "2": "LABEL_2"
33
+ },
34
+ "init_std": 0.02,
35
+ "is_encoder_decoder": true,
36
+ "label2id": {
37
+ "LABEL_0": 0,
38
+ "LABEL_1": 1,
39
+ "LABEL_2": 2
40
+ },
41
+ "max_position_embeddings": 1024,
42
+ "model_type": "bart",
43
+ "no_repeat_ngram_size": 3,
44
+ "normalize_before": false,
45
+ "normalize_embedding": true,
46
+ "num_beams": 4,
47
+ "num_hidden_layers": 6,
48
+ "pad_token_id": 1,
49
+ "scale_embedding": false,
50
+ "task_specific_params": {
51
+ "summarization": {
52
+ "length_penalty": 1.0,
53
+ "max_length": 128,
54
+ "min_length": 12,
55
+ "num_beams": 4
56
+ },
57
+ "summarization_cnn": {
58
+ "length_penalty": 2.0,
59
+ "max_length": 142,
60
+ "min_length": 56,
61
+ "num_beams": 4
62
+ },
63
+ "summarization_xsum": {
64
+ "length_penalty": 1.0,
65
+ "max_length": 62,
66
+ "min_length": 11,
67
+ "num_beams": 6
68
+ }
69
+ },
70
+ "transformers_version": "4.5.1",
71
+ "use_cache": true,
72
+ "vocab_size": 50266
73
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee78539745a77bc0f7ca373973dccac38f2cc2c8e99aa211738b052cb48ebec7
3
+ size 557986175
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "<s>", "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false}}
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"unk_token": "<unk>", "bos_token": "<s>", "eos_token": "</s>", "add_prefix_space": false, "errors": "replace", "sep_token": "</s>", "cls_token": "<s>", "pad_token": "<pad>", "mask_token": "<mask>", "model_max_length": 1024, "special_tokens_map_file": null, "name_or_path": "facebook/bart-base"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff