/
kbqa_cq_rus.json
205 lines (204 loc) · 6.66 KB
/
kbqa_cq_rus.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
{
"chainer": {
"in": ["x_init"],
"in_y": ["y"],
"pipe": [
{
"class_name": "question_sign_checker",
"in": ["x_init"],
"out": ["x"]
},
{
"config_path": "{CONFIGS_PATH}/ner/ner_bert_ent_and_type_rus.json",
"in": ["x"],
"out": ["x_tokens", "y_pred"]
},
{
"in": ["x_tokens", "y_pred"],
"out": ["entities", "types", "entities_pos"],
"thres_proba": 0.4,
"entity_tags": ["E-TAG"],
"type_tag": "T-TAG",
"o_tag": "O-TAG",
"tags_file": "{NER_PATH}/tag.dict",
"ignore_points": true,
"class_name": "entity_detection_parser"
},
{
"class_name": "wiki_parser",
"id": "wiki_p",
"wiki_filename": "{DOWNLOADS_PATH}/wikidata/wikidata.hdt",
"lang": "@ru"
},
{
"config_path": "{CONFIGS_PATH}/syntax/syntax_ru_syntagrus_bert.json",
"in": ["x"],
"out": ["syntax_info"]
},
{
"class_name": "ru_adj_to_noun",
"freq_dict_filename": "{DOWNLOADS_PATH}/wikidata_rus/freqrnc2011.csv",
"id": "adj2noun"
},
{
"class_name": "tree_to_sparql",
"sparql_queries_filename": "{DOWNLOADS_PATH}/wikidata/sparql_queries.json",
"adj_to_noun": "#adj2noun",
"lang": "rus",
"in": ["syntax_info", "entities_pos"],
"out": ["x_sanitized", "query_nums", "entities_dict", "types_dict"]
},
{
"class_name": "template_matcher",
"id": "template_m",
"num_processors": 8,
"load_path": "{DOWNLOADS_PATH}/wikidata_rus",
"templates_filename": "templates_rus.json"
},
{
"class_name": "rel_ranking_bert_infer",
"id": "entity_descr_ranking",
"ranker": {"config_path": "{CONFIGS_PATH}/classifiers/entity_ranking_bert_rus_no_mention.json"},
"batch_size": 100,
"load_path": "{DOWNLOADS_PATH}/wikidata_rus",
"rel_q2name_filename": "q_to_descr_ru.pickle",
"rels_to_leave": 200
},
{
"class_name": "kbqa_entity_linker",
"id": "linker_entities",
"load_path": "{DOWNLOADS_PATH}/wikidata_rus",
"inverted_index_filename": "inverted_index_rus.pickle",
"entities_list_filename": "entities_list_rus.pickle",
"q2name_filename": "wiki_rus_q_to_name.pickle",
"entity_ranker": "#entity_descr_ranking",
"build_inverted_index": false,
"lemmatize": true,
"use_descriptions": true,
"include_mention": false,
"use_prefix_tree": false,
"lang": "ru"
},
{
"class_name": "kbqa_entity_linker",
"id": "linker_types",
"load_path": "{DOWNLOADS_PATH}/wikidata_rus",
"inverted_index_filename": "inverted_index_types_rus.pickle",
"entities_list_filename": "types_list_rus.pickle",
"q2name_filename": "wiki_rus_q_to_name_types.pickle",
"build_inverted_index": false,
"lemmatize": true,
"use_descriptions": false,
"use_prefix_tree": false,
"lang": "ru"
},
{
"class_name": "rel_ranking_bert_infer",
"id": "rel_r_inf",
"ranker": {"config_path": "{CONFIGS_PATH}/classifiers/rel_ranking_bert_rus.json"},
"wiki_parser": "#wiki_p",
"batch_size": 32,
"return_all_possible_answers": false,
"return_answer_ids": false,
"load_path": "{DOWNLOADS_PATH}/wikidata_rus",
"rel_q2name_filename": "wiki_dict_properties_rus.pickle"
},
{
"class_name": "query_generator",
"id": "query_g",
"linker_entities": "#linker_entities",
"linker_types": "#linker_types",
"template_matcher": "#template_m",
"rel_ranker": "#rel_r_inf",
"wiki_parser": "#wiki_p",
"load_path": "{DOWNLOADS_PATH}/wikidata_rus",
"rank_rels_filename_1": "rels_0.txt",
"rank_rels_filename_2": "rels_1.txt",
"sparql_queries_filename": "{DOWNLOADS_PATH}/wikidata/sparql_queries.json",
"entities_to_leave": 9,
"rels_to_leave": 10,
"return_answers": true,
"return_all_possible_answers": false,
"syntax_structure_known": true,
"in": ["x", "x_sanitized", "query_nums", "entities_dict", "types_dict"],
"out": ["answers"]
}
],
"out": ["answers"]
},
"train": {
"epochs": 30,
"batch_size": 16,
"metrics": [
{
"name": "ner_f1",
"inputs": ["y", "y_pred"]
},
{
"name": "ner_token_f1",
"inputs": ["y", "y_pred"]
}
],
"validation_patience": 10,
"val_every_n_batches": 400,
"log_every_n_batches": 400,
"tensorboard_log_dir": "{NER_PATH}/logs",
"show_examples": false,
"pytest_max_batches": 2,
"pytest_batch_size": 8,
"evaluation_targets": ["valid", "test"],
"class_name": "nn_trainer"
},
"metadata": {
"variables": {
"ROOT_PATH": "~/.deeppavlov",
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
"MODELS_PATH": "{ROOT_PATH}/models",
"BERT_PATH": "{DOWNLOADS_PATH}/bert_models/multi_cased_L-12_H-768_A-12",
"NER_PATH": "{MODELS_PATH}/ner_ent_and_type_rus",
"CONFIGS_PATH": "{DEEPPAVLOV_PATH}/configs"
},
"labels": {
"telegram_utils": "NERCoNLL2003Model",
"server_utils": "NER"
},
"download": [
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/bert/multi_cased_L-12_H-768_A-12.zip",
"subdir": "{DOWNLOADS_PATH}/bert_models"
},
{
"url": "http://files.deeppavlov.ai/kbqa/models/ner_cq_rus.tar.gz",
"subdir": "{NER_PATH}"
},
{
"url": "http://files.deeppavlov.ai/kbqa/models/rel_ranking_bert_rus.tar.gz",
"subdir": "{MODELS_PATH}/rel_ranking_bert_rus"
},
{
"url": "http://files.deeppavlov.ai/kbqa/models/entity_ranking_bert_rus_no_mention.tar.gz",
"subdir": "{MODELS_PATH}/entity_ranking_bert_rus_no_mention"
},
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/syntax_parser/syntax_ru_syntagrus_bert.tar.gz",
"subdir": "{MODELS_PATH}/syntax_ru_syntagrus"
},
{
"url": "http://files.deeppavlov.ai/kbqa/wikidata/wiki_rus_files.tar.gz",
"subdir": "{DOWNLOADS_PATH}/wikidata_rus"
},
{
"url": "http://files.deeppavlov.ai/kbqa/wikidata/sparql_queries.json",
"subdir": "{DOWNLOADS_PATH}/wikidata"
},
{
"url": "http://files.deeppavlov.ai/kbqa/wikidata/wikidata.hdt",
"subdir": "{DOWNLOADS_PATH}/wikidata"
},
{
"url": "http://files.deeppavlov.ai/kbqa/wikidata/wikidata.hdt.index.v1-1",
"subdir": "{DOWNLOADS_PATH}/wikidata"
}
]
}
}