Skip to content

Commit

Permalink
Release 0.11.0 (#1260)
Browse files Browse the repository at this point in the history
Release 0.11.0
  • Loading branch information
IgnatovFedor committed Jun 30, 2020
2 parents 65f69df + 63859b6 commit 4f947ee
Show file tree
Hide file tree
Showing 49 changed files with 3,511 additions and 1,187 deletions.
2 changes: 1 addition & 1 deletion deeppavlov/_meta.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.10.0'
__version__ = '0.11.0'
__author__ = 'Neural Networks and Deep Learning lab, MIPT'
__description__ = 'An open source library for building end-to-end dialog systems and training chatbots.'
__keywords__ = ['NLP', 'NER', 'SQUAD', 'Intents', 'Chatbot']
Expand Down
80 changes: 80 additions & 0 deletions deeppavlov/configs/classifiers/rel_ranking_bert_rus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"dataset_reader": {
"class_name": "paraphraser_reader",
"data_path": "{DOWNLOADS_PATH}/rel_ranking_rus",
"do_lower_case": false
},
"dataset_iterator": {
"class_name": "siamese_iterator",
"seed": 243,
"len_valid": 500
},
"chainer": {
"in": ["text_a", "text_b"],
"in_y": ["y"],
"pipe": [
{
"class_name": "bert_preprocessor",
"vocab_file": "{DOWNLOADS_PATH}/bert_models/multi_cased_L-12_H-768_A-12/vocab.txt",
"do_lower_case": false,
"max_seq_length": 64,
"in": ["text_a", "text_b"],
"out": ["bert_features"]
},
{
"class_name": "bert_classifier",
"n_classes": 2,
"return_probas": true,
"one_hot_labels": false,
"bert_config_file": "{DOWNLOADS_PATH}/bert_models/multi_cased_L-12_H-768_A-12/bert_config.json",
"pretrained_bert": "{DOWNLOADS_PATH}/bert_models/multi_cased_L-12_H-768_A-12/bert_model.ckpt",
"save_path": "{MODEL_PATH}/model",
"load_path": "{MODEL_PATH}/model",
"keep_prob": 0.5,
"learning_rate": 2e-05,
"learning_rate_drop_patience": 2,
"learning_rate_drop_div": 2.0,
"in": ["bert_features"],
"in_y": ["y"],
"out": ["predictions"]
}
],
"out": ["predictions"]
},
"train": {
"batch_size": 32,
"pytest_max_batches": 2,
"metrics": ["f1", "acc"],
"validation_patience": 10,
"val_every_n_batches": 100,
"log_every_n_batches": 100,
"evaluation_targets": ["train", "valid", "test"],
"tensorboard_log_dir": "{MODEL_PATH}/"
},
"metadata": {
"variables": {
"ROOT_PATH": "~/.deeppavlov",
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
"MODELS_PATH": "{ROOT_PATH}/models",
"MODEL_PATH": "{MODELS_PATH}/rel_ranking_bert_rus"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/tf.txt",
"{DEEPPAVLOV_PATH}/requirements/bert_dp.txt"
],
"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/datasets/rel_ranking_bert_rus.tar.gz",
"subdir": "{DOWNLOADS_PATH}/rel_ranking_rus"
},
{
"url": "http://files.deeppavlov.ai/kbqa/models/rel_ranking_bert_rus.tar.gz",
"subdir": "{MODELS_PATH}/rel_ranking_bert_rus"
}
]
}
}
28 changes: 11 additions & 17 deletions deeppavlov/configs/kbqa/kbqa_cq.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
{
"dataset_reader": {
"class_name": "sq_reader",
"data_path": "{DOWNLOADS_PATH}/lcquad/entity_detection_dataset.pickle"
},
"dataset_iterator": {
"class_name": "data_learning_iterator"
},
"chainer": {
"in": ["x"],
"in_y": ["y"],
Expand All @@ -17,13 +10,14 @@
},
{
"in": ["x_tokens", "y_pred"],
"out": ["entities", "types"],
"out": ["entities", "types", "entities_pos"],
"class_name": "entity_detection_parser"
},
{
"class_name": "wiki_parser",
"id": "wiki_p",
"wiki_filename": "{DOWNLOADS_PATH}/wikidata_eng/wikidata.hdt"
"wiki_filename": "{DOWNLOADS_PATH}/wikidata/wikidata.hdt",
"lang": "@en"
},
{
"class_name": "template_matcher",
Expand All @@ -44,8 +38,8 @@
"inverted_index_filename": "inverted_index_eng.pickle",
"entities_list_filename": "entities_list.pickle",
"q2name_filename": "wiki_eng_q_to_name.pickle",
"use_hdt": false,
"wiki_parser": "#wiki_p",
"build_inverted_index": false,
"use_descriptions": false,
"use_prefix_tree": false
},
{
Expand All @@ -55,8 +49,8 @@
"inverted_index_filename": "inverted_index_types_eng.pickle",
"entities_list_filename": "types_list.pickle",
"q2name_filename": "wiki_eng_q_to_name_types.pickle",
"use_hdt": false,
"wiki_parser": "#wiki_p",
"build_inverted_index": false,
"use_descriptions": false,
"use_prefix_tree": false
},
{
Expand All @@ -78,7 +72,7 @@
"load_path": "{DOWNLOADS_PATH}/wikidata_eng",
"rank_rels_filename_1": "rels_0.txt",
"rank_rels_filename_2": "rels_1.txt",
"sparql_queries_filename": "sparql_queries.json",
"sparql_queries_filename": "{DOWNLOADS_PATH}/wikidata/sparql_queries.json",
"entities_to_leave": 5,
"rels_to_leave": 10,
"in": ["x", "template_type", "entities", "types"],
Expand Down Expand Up @@ -172,15 +166,15 @@
},
{
"url": "http://files.deeppavlov.ai/kbqa/wikidata/sparql_queries.json",
"subdir": "{DOWNLOADS_PATH}/wikidata_eng"
"subdir": "{DOWNLOADS_PATH}/wikidata"
},
{
"url": "http://files.deeppavlov.ai/kbqa/wikidata/wikidata.hdt",
"subdir": "{DOWNLOADS_PATH}/wikidata_eng"
"subdir": "{DOWNLOADS_PATH}/wikidata"
},
{
"url": "http://files.deeppavlov.ai/kbqa/wikidata/wikidata.hdt.index.v1-1",
"subdir": "{DOWNLOADS_PATH}/wikidata_eng"
"subdir": "{DOWNLOADS_PATH}/wikidata"
}
]
}
Expand Down
20 changes: 7 additions & 13 deletions deeppavlov/configs/kbqa/kbqa_cq_bert_ranker.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
{
"dataset_reader": {
"class_name": "sq_reader",
"data_path": "{DOWNLOADS_PATH}/lcquad/entity_detection_dataset.pickle"
},
"dataset_iterator": {
"class_name": "data_learning_iterator"
},
"chainer": {
"in": ["x"],
"in_y": ["y"],
Expand All @@ -17,13 +10,14 @@
},
{
"in": ["x_tokens", "y_pred"],
"out": ["entities", "types"],
"out": ["entities", "types", "entities_pos"],
"class_name": "entity_detection_parser"
},
{
"class_name": "wiki_parser",
"id": "wiki_p",
"wiki_filename": "{DOWNLOADS_PATH}/wikidata_eng/wikidata.hdt"
"wiki_filename": "{DOWNLOADS_PATH}/wikidata/wikidata.hdt",
"lang": "@en"
},
{
"class_name": "template_matcher",
Expand Down Expand Up @@ -79,7 +73,7 @@
"load_path": "{DOWNLOADS_PATH}/wikidata_eng",
"rank_rels_filename_1": "rels_0.txt",
"rank_rels_filename_2": "rels_1.txt",
"sparql_queries_filename": "sparql_queries.json",
"sparql_queries_filename": "{DOWNLOADS_PATH}/wikidata/sparql_queries.json",
"entities_to_leave": 5,
"rels_to_leave": 12,
"return_answers": true,
Expand Down Expand Up @@ -164,15 +158,15 @@
},
{
"url": "http://files.deeppavlov.ai/kbqa/wikidata/sparql_queries.json",
"subdir": "{DOWNLOADS_PATH}/wikidata_eng"
"subdir": "{DOWNLOADS_PATH}/wikidata"
},
{
"url": "http://files.deeppavlov.ai/kbqa/wikidata/wikidata.hdt",
"subdir": "{DOWNLOADS_PATH}/wikidata_eng"
"subdir": "{DOWNLOADS_PATH}/wikidata"
},
{
"url": "http://files.deeppavlov.ai/kbqa/wikidata/wikidata.hdt.index.v1-1",
"subdir": "{DOWNLOADS_PATH}/wikidata_eng"
"subdir": "{DOWNLOADS_PATH}/wikidata"
}
]
}
Expand Down
172 changes: 172 additions & 0 deletions deeppavlov/configs/kbqa/kbqa_cq_online.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
{
"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"],
"class_name": "entity_detection_parser"
},
{
"class_name": "wiki_parser_online",
"id": "wiki_p",
"url": "https://query.wikidata.org/sparql"
},
{
"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": "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",
"use_hdt": false,
"wiki_parser": "#wiki_p",
"use_prefix_tree": false
},
{
"class_name": "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",
"use_hdt": false,
"wiki_parser": "#wiki_p",
"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_online",
"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",
"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"
],
"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": "{MODELS_PATH}/wikidata_eng"
},
{
"url": "http://files.deeppavlov.ai/kbqa/wikidata/sparql_queries.json",
"subdir": "{DOWNLOADS_PATH}/wikidata"
}
]
}
}

0 comments on commit 4f947ee

Please sign in to comment.