/
bot_kvret_train.json
176 lines (174 loc) · 5.2 KB
/
bot_kvret_train.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
{
"dataset_reader": {
"class_name": "kvret_reader",
"data_path": "{DOWNLOADS_PATH}/kvret"
},
"dataset_iterator": {
"class_name": "kvret_dialog_iterator",
"shuffle": false
},
"chainer": {
"in": ["x_text", "dialog_id", "history", "kb_columns", "kb_items"],
"in_y": ["y_text", "y_domain"],
"out": ["prediction_text"],
"pipe": [
{
"id": "stream_spacy",
"class_name": "stream_spacy_tokenizer",
"lowercase": true,
"alphas_only": false,
"in": ["x_text"],
"out": ["x_tokens"]
},
{
"ref": "stream_spacy",
"in": ["y_text"],
"out": ["y_tokens"]
},
{
"ref": "stream_spacy",
"in": ["history"],
"out": ["history_tokens"]
},
{
"id": "kb",
"class_name": "knowledge_base",
"fit_on": ["dialog_id", "kb_columns", "kb_items"],
"tokenizer": "#stream_spacy",
"in": ["dialog_id", "kb_columns", "kb_items"],
"out": ["kb_entries"],
"save_path": "{MODELS_PATH}/seq2seq_go_bot/kvret_kb.json",
"load_path": "{MODELS_PATH}/seq2seq_go_bot/kvret_kb.json"
},
{
"class_name": "knowledge_base_entity_normalizer",
"in": ["y_tokens", "kb_entries"],
"out": ["y_norm_tokens"]
},
{
"class_name": "knowledge_base_entity_normalizer",
"remove": true,
"in": ["y_tokens", "kb_entries"],
"out": ["y_without_entities_tokens"]
},
{
"id": "src_token_vocab",
"fit_on": ["x_tokens", "y_tokens"],
"class_name": "simple_vocab",
"min_freq": 2,
"unk_token": "<UNK>",
"special_tokens": ["<UNK>", "<SOS>"],
"save_path": "{MODELS_PATH}/vocabs/kvret_src_tokens.dict",
"load_path": "{MODELS_PATH}/vocabs/kvret_src_tokens.dict"
},
{
"id": "tgt_token_vocab",
"fit_on": ["y_without_entities_tokens"],
"class_name": "simple_vocab",
"unk_token": "<UNK>",
"special_tokens": ["<UNK>", "<SOS>", "<EOS>"],
"save_path": "{MODELS_PATH}/vocabs/kvret_tgt_tokens.dict",
"load_path": "{MODELS_PATH}/vocabs/kvret_tgt_tokens.dict"
},
{
"id": "token_embedder",
"class_name": "fasttext",
"load_path": "{DOWNLOADS_PATH}/embeddings/wiki.en.bin"
},
{
"in": ["x_tokens", "history_tokens", "kb_entries"],
"in_y": ["y_norm_tokens"],
"out": ["prediction_norm_tokens"],
"main": true,
"class_name": "seq2seq_go_bot",
"load_path": "{MODELS_PATH}/seq2seq_go_bot/model",
"save_path": "{MODELS_PATH}/seq2seq_go_bot/model",
"start_of_sequence_token": "<SOS>",
"end_of_sequence_token": "<EOS>",
"embedder": "#token_embedder",
"network_parameters": {
"learning_rate": 0.0002,
"dropout_rate": 0.2,
"state_dropout_rate": 0.07,
"beam_width": 1,
"target_start_of_sequence_index": "#tgt_token_vocab.__getitem__('<SOS>')",
"target_end_of_sequence_index": "#tgt_token_vocab.__getitem__('<EOS>')",
"source_vocab_size": "#src_token_vocab.__len__()",
"target_vocab_size": "#tgt_token_vocab.__len__()",
"hidden_size": 256,
"kb_attention_hidden_sizes": [64, 32]
},
"debug": false,
"source_vocab": "#src_token_vocab",
"target_vocab": "#tgt_token_vocab",
"knowledge_base_keys": "#kb.primary_keys"
},
{
"class_name": "knowledge_base_entity_normalizer",
"denormalize": true,
"in": ["prediction_norm_tokens", "kb_entries"],
"out": ["prediction_tokens"]
},
{
"ref": "stream_spacy",
"in": ["prediction_tokens"],
"out": ["prediction_text"]
}
]
},
"train": {
"epochs": 200,
"batch_size": 16,
"metrics": [
{
"name": "google_bleu",
"inputs": ["y_text", "prediction_text"]
},
{
"name": "bleu",
"inputs": ["y_text", "prediction_text"]
},
{
"name": "accuracy",
"inputs": ["y_text", "prediction_text"]
}
],
"validation_patience": 30,
"val_every_n_epochs": 1,
"log_every_n_batches": -1,
"log_every_n_epochs": 1,
"show_examples": false,
"class_name": "nn_trainer",
"evaluation_targets": [
"valid",
"test"
]
},
"metadata": {
"variables": {
"ROOT_PATH": "~/.deeppavlov",
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
"MODELS_PATH": "{ROOT_PATH}/models"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/tf.txt",
"{DEEPPAVLOV_PATH}/requirements/spacy.txt",
"{DEEPPAVLOV_PATH}/requirements/en_core_web_sm.txt",
"{DEEPPAVLOV_PATH}/requirements/fasttext.txt"
],
"download": [
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/vocabs.tar.gz",
"subdir": "{MODELS_PATH}"
},
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/seq2seq_go_bot_v2.tar.gz",
"subdir": "{MODELS_PATH}"
},
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/embeddings/wiki.en.bin",
"subdir": "{DOWNLOADS_PATH}/embeddings"
}
]
}
}