/
squad.json
141 lines (141 loc) · 4.92 KB
/
squad.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
{
"dataset_reader": {
"class_name": "squad_dataset_reader",
"data_path": "{DOWNLOADS_PATH}/squad/"
},
"dataset_iterator": {
"class_name": "squad_iterator",
"seed": 1337,
"shuffle": true
},
"chainer": {
"in": ["context_raw", "question_raw"],
"in_y": ["ans_raw", "ans_raw_start"],
"pipe": [
{
"class_name": "squad_preprocessor",
"id": "squad_prepr",
"context_limit": 400,
"question_limit": 150,
"char_limit": 16,
"in": ["context_raw", "question_raw"],
"out": ["context", "context_tokens", "context_chars",
"c_r2p", "c_p2r", "question",
"question_tokens", "question_chars", "spans"]
},
{
"class_name": "squad_ans_preprocessor",
"id": "squad_ans_prepr",
"in": ["ans_raw", "ans_raw_start", "c_r2p", "spans"],
"out": ["ans", "ans_start", "ans_end"]
},
{
"class_name": "squad_vocab_embedder",
"id": "vocab_embedder",
"level": "token",
"emb_folder": "{DOWNLOADS_PATH}/embeddings/",
"emb_url": "http://files.deeppavlov.ai/embeddings/wiki-news-300d-1M.vec",
"save_path": "{MODELS_PATH}/squad_model/emb/vocab_embedder.pckl",
"load_path": "{MODELS_PATH}/squad_model/emb/vocab_embedder.pckl",
"context_limit": "#squad_prepr.context_limit",
"question_limit": "#squad_prepr.question_limit",
"char_limit": "#squad_prepr.char_limit",
"fit_on": ["context_tokens", "question_tokens"],
"in": ["context_tokens", "question_tokens"],
"out": ["context_tokens_idxs", "question_tokens_idxs"]
},
{
"class_name": "squad_vocab_embedder",
"id": "char_vocab_embedder",
"level": "char",
"emb_folder": "{DOWNLOADS_PATH}/embeddings/",
"emb_url": "http://files.deeppavlov.ai/embeddings/wiki-news-300d-1M-char.vec",
"save_path": "{MODELS_PATH}/squad_model/emb/char_vocab_embedder.pckl",
"load_path": "{MODELS_PATH}/squad_model/emb/char_vocab_embedder.pckl",
"context_limit": "#squad_prepr.context_limit",
"question_limit": "#squad_prepr.question_limit",
"char_limit": "#squad_prepr.char_limit",
"fit_on": ["context_chars", "question_chars"],
"in": ["context_chars", "question_chars"],
"out": ["context_chars_idxs", "question_chars_idxs"]
},
{
"class_name": "squad_model",
"id": "squad",
"word_emb": "#vocab_embedder.emb_mat",
"char_emb": "#char_vocab_embedder.emb_mat",
"context_limit": "#squad_prepr.context_limit",
"question_limit": "#squad_prepr.question_limit",
"char_limit": "#squad_prepr.char_limit",
"train_char_emb": true,
"char_hidden_size": 100,
"encoder_hidden_size": 75,
"attention_hidden_size": 75,
"min_learning_rate": 0.001,
"keep_prob": 0.7,
"clip_norm": 5.0,
"learning_rate": 0.5,
"learning_rate_drop_patience": 5,
"learning_rate_drop_div": 2.0,
"optimizer": "tf.train:AdadeltaOptimizer",
"momentum": 0.95,
"save_path": "{MODELS_PATH}/squad_model/model",
"load_path": "{MODELS_PATH}/squad_model/model",
"in": ["context_tokens_idxs", "context_chars_idxs", "question_tokens_idxs", "question_chars_idxs"],
"in_y": ["ans_start", "ans_end"],
"out": ["ans_start_predicted", "ans_end_predicted", "logits"]
},
{
"class_name": "squad_ans_postprocessor",
"id": "squad_ans_postprepr",
"in": ["ans_start_predicted", "ans_end_predicted", "context_raw", "c_p2r", "spans"],
"out": ["ans_predicted", "ans_start_predicted", "ans_end_predicted"]
}
],
"out": ["ans_predicted", "ans_start_predicted", "logits"]
},
"train": {
"show_examples": false,
"log_every_n_batches": 250,
"val_every_n_epochs": 1,
"batch_size": 50,
"pytest_max_batches": 2,
"validation_patience": 10,
"metrics": [
{
"name": "squad_v1_f1",
"inputs": ["ans_raw", "ans_predicted"]
},
{
"name": "squad_v1_em",
"inputs": ["ans_raw", "ans_predicted"]
}
],
"evaluation_targets": ["valid"],
"class_name": "nn_trainer"
},
"metadata": {
"variables": {
"ROOT_PATH": "~/.deeppavlov",
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
"MODELS_PATH": "{ROOT_PATH}/models"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/tf.txt"
],
"download": [
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/squad_model_1.4_cpu_compatible.tar.gz",
"subdir": "{MODELS_PATH}"
},
{
"url": "http://files.deeppavlov.ai/embeddings/wiki-news-300d-1M.vec",
"subdir": "{DOWNLOADS_PATH}/embeddings"
},
{
"url": "http://files.deeppavlov.ai/embeddings/wiki-news-300d-1M-char.vec",
"subdir": "{DOWNLOADS_PATH}/embeddings"
}
]
}
}