/
kbqa_cq.json
187 lines (186 loc) · 6.08 KB
/
kbqa_cq.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
{
"chainer": {
"in": ["x"],
"in_y": ["y"],
"pipe": [
{
"config_path": "{CONFIGS_PATH}/ner/ner_lcquad_bert_ent_and_type.json",
"in": ["x"],
"out": ["x_tokens", "y_pred"]
},
{
"in": ["x_tokens", "y_pred"],
"out": ["entities", "types", "entities_pos"],
"entity_tags": ["E-TAG"],
"type_tag": "T-TAG",
"o_tag": "O-TAG",
"tags_file": "{NER_PATH}/tag.dict",
"class_name": "entity_detection_parser"
},
{
"class_name": "wiki_parser",
"id": "wiki_p",
"wiki_filename": "{DOWNLOADS_PATH}/wikidata/wikidata.hdt",
"lang": "@en"
},
{
"class_name": "template_matcher",
"id": "template_m",
"num_processors": 8,
"load_path": "{DOWNLOADS_PATH}/wikidata_eng",
"templates_filename": "templates_eng.json"
},
{
"config_path": "{CONFIGS_PATH}/classifiers/query_pr.json",
"in": ["x"],
"out": ["template_type"]
},
{
"class_name": "kbqa_entity_linker",
"id": "linker_entities",
"load_path": "{DOWNLOADS_PATH}/wikidata_eng",
"inverted_index_filename": "inverted_index_eng.pickle",
"entities_list_filename": "entities_list.pickle",
"q2name_filename": "wiki_eng_q_to_name.pickle",
"build_inverted_index": false,
"use_descriptions": false,
"use_prefix_tree": false
},
{
"class_name": "kbqa_entity_linker",
"id": "linker_types",
"load_path": "{DOWNLOADS_PATH}/wikidata_eng",
"inverted_index_filename": "inverted_index_types_eng.pickle",
"entities_list_filename": "types_list.pickle",
"q2name_filename": "wiki_eng_q_to_name_types.pickle",
"build_inverted_index": false,
"use_descriptions": false,
"use_prefix_tree": false
},
{
"class_name": "rel_ranking_infer",
"id": "rel_r_inf",
"ranker": {"config_path": "{CONFIGS_PATH}/ranking/rel_ranking.json"},
"load_path": "{DOWNLOADS_PATH}/wikidata_eng",
"rel_q2name_filename": "wiki_dict_properties.pickle",
"rels_to_leave": 40
},
{
"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_eng",
"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": 5,
"rels_to_leave": 10,
"in": ["x", "template_type", "entities", "types"],
"out": ["candidate_answers"]
},
{
"class_name": "rel_ranking_bert_infer",
"ranker": {"config_path": "{CONFIGS_PATH}/classifiers/rel_ranking_bert.json"},
"wiki_parser": "#wiki_p",
"batch_size": 32,
"load_path": "{DOWNLOADS_PATH}/wikidata_eng",
"rel_q2name_filename": "wiki_dict_properties.pickle",
"in": ["x", "candidate_answers"],
"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/cased_L-12_H-768_A-12",
"NER_PATH": "{MODELS_PATH}/ner_lcquad_ent_and_type",
"CONFIGS_PATH": "{DEEPPAVLOV_PATH}/configs"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/tf.txt",
"{DEEPPAVLOV_PATH}/requirements/bert_dp.txt",
"{DEEPPAVLOV_PATH}/requirements/fasttext.txt",
"{DEEPPAVLOV_PATH}/requirements/rapidfuzz.txt",
"{DEEPPAVLOV_PATH}/requirements/hdt.txt",
"{DEEPPAVLOV_PATH}/requirements/faiss.txt",
"{DEEPPAVLOV_PATH}/requirements/spelling.txt"
],
"labels": {
"telegram_utils": "NERCoNLL2003Model",
"server_utils": "NER"
},
"download": [
{
"url": "http://files.deeppavlov.ai/embeddings/reddit_fastText/wordpunct_tok_reddit_comments_2017_11_300.bin",
"subdir": "{DOWNLOADS_PATH}/embeddings"
},
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/bert/cased_L-12_H-768_A-12.zip",
"subdir": "{DOWNLOADS_PATH}/bert_models"
},
{
"url": "http://files.deeppavlov.ai/kbqa/models/query_prediction.tar.gz",
"subdir": "{MODELS_PATH}/classifiers/query_prediction"
},
{
"url": "http://files.deeppavlov.ai/kbqa/models/ner_lcquad.tar.gz",
"subdir": "{MODELS_PATH}/ner_lcquad"
},
{
"url": "http://files.deeppavlov.ai/kbqa/models/rel_ranking.tar.gz",
"subdir": "{MODELS_PATH}/rel_ranking"
},
{
"url": "http://files.deeppavlov.ai/kbqa/models/rel_ranking_bert.tar.gz",
"subdir": "{MODELS_PATH}/rel_ranking_bert"
},
{
"url": "http://files.deeppavlov.ai/kbqa/wikidata/wiki_eng_files.tar.gz",
"subdir": "{DOWNLOADS_PATH}/wikidata_eng"
},
{
"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"
}
]
}
}