Skip to content

Commit

Permalink
Merge pull request #1313 from deepmipt/dev
Browse files Browse the repository at this point in the history
Release 0.12.1
  • Loading branch information
IgnatovFedor authored Sep 9, 2020
2 parents 8bf0b4b + 4895719 commit b66179e
Show file tree
Hide file tree
Showing 44 changed files with 935 additions and 189 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.12.0'
__version__ = '0.12.1'
__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
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"dataset_reader": {
"class_name": "paraphraser_reader",
"data_path": "{DOWNLOADS_PATH}/entity_ranking_bert_eng_no_mention",
"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/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/cased_L-12_H-768_A-12/bert_config.json",
"pretrained_bert": "{DOWNLOADS_PATH}/bert_models/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}/entity_ranking_bert_eng_no_mention"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/tf.txt",
"{DEEPPAVLOV_PATH}/requirements/bert_dp.txt"
],
"download": [
{
"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/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"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@
"valid",
"test"
],
"class_name": "torch_trainer",
"tensorboard_log_dir": "{MODEL_PATH}/"
"class_name": "torch_trainer"
},
"metadata": {
"variables": {
Expand Down
95 changes: 95 additions & 0 deletions deeppavlov/configs/kbqa/entity_linking_eng.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"chainer": {
"in": ["documents"],
"pipe": [
{
"class_name": "ner_chunker",
"id": "chunker"
},
{
"thres_proba": 0.05,
"entity_tags": ["PERSON", "LOC", "ORG", "GPE", "EVENT", "WORK_OF_ART"],
"type_tag": "TYPE",
"o_tag": "O",
"tags_file": "{NER_PATH}/tag.dict",
"return_entities_with_tags": true,
"class_name": "entity_detection_parser",
"id": "edp"
},
{
"class_name": "rel_ranking_bert_infer",
"id": "entity_descr_ranking",
"ranker": {"config_path": "{CONFIGS_PATH}/classifiers/entity_ranking_bert_eng_no_mention.json"},
"batch_size": 100,
"load_path": "{DOWNLOADS_PATH}/wikidata_eng",
"rel_q2name_filename": "q_to_descr_en.pickle",
"rels_to_leave": 200
},
{
"class_name": "entity_linker",
"in": ["documents"],
"out": ["entity_substr_list", "entity_positions_list", "entity_ids_list"],
"load_path": "{DOWNLOADS_PATH}/wikidata_eng",
"save_path": "{DOWNLOADS_PATH}/wikidata_eng",
"word_to_idlist_filename": "word_to_idlist_eng.pickle",
"entities_list_filename": "ent_list_eng.pickle",
"entities_ranking_filename": "entities_ranking_dict_eng.pickle",
"vectorizer_filename": "vectorizer_eng.pk",
"faiss_index_filename": "{DOWNLOADS_PATH}/wikidata_eng/faiss_vectors_eng.index",
"q_to_descr_filename": "q_to_descr_en.pickle",
"chunker": "#chunker",
"ner": {"config_path": "{CONFIGS_PATH}/ner/ner_ontonotes_bert_probas.json"},
"ner_parser": "#edp",
"entity_ranker": "#entity_descr_ranking",
"num_faiss_candidate_entities": 10,
"num_entities_for_bert_ranking": 200,
"num_faiss_cells": 50,
"use_gpu": false,
"fit_vectorizer": false,
"max_tfidf_features": 500,
"include_mention": false,
"ngram_range": [2, 2],
"num_entities_to_return": 1,
"build_inverted_index": false,
"lemmatize": false,
"use_descriptions": true,
"use_prefix_tree": false,
"lang": "en"
}
],
"out": ["entity_substr_list", "entity_positions_list", "entity_ids_list"]
},
"metadata": {
"variables": {
"ROOT_PATH": "~/.deeppavlov",
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
"MODELS_PATH": "{ROOT_PATH}/models",
"CONFIGS_PATH": "{DEEPPAVLOV_PATH}/configs",
"NER_PATH": "{MODELS_PATH}/ner_ontonotes_bert"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/tf.txt",
"{DEEPPAVLOV_PATH}/requirements/bert_dp.txt",
"{DEEPPAVLOV_PATH}/requirements/faiss.txt",
"{DEEPPAVLOV_PATH}/requirements/hdt.txt"
],
"download": [
{
"url": "http://files.deeppavlov.ai/kbqa/wikidata/entity_linking_eng.tar.gz",
"subdir": "{DOWNLOADS_PATH}/wikidata_eng"
},
{
"url": "http://files.deeppavlov.ai/kbqa/models/ner_ontonotes_bert.tar.gz",
"subdir": "{MODELS_PATH}/ner_ontonotes_bert"
},
{
"url": "http://files.deeppavlov.ai/kbqa/models/entity_ranking_bert_eng_no_mention.tar.gz",
"subdir": "{MODELS_PATH}/entity_ranking_bert_eng_no_mention"
},
{
"url": "http://files.deeppavlov.ai/kbqa/wikidata/q_to_descr_en.pickle",
"subdir": "{DOWNLOADS_PATH}/wikidata_eng"
}
]
}
}
14 changes: 10 additions & 4 deletions deeppavlov/configs/kbqa/kbqa_cq.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"chainer": {
"in": ["x"],
"in": ["x_init"],
"in_y": ["y"],
"pipe": [
{
"class_name": "question_sign_checker",
"in": ["x_init"],
"out": ["x"]
},
{
"config_path": "{CONFIGS_PATH}/ner/ner_lcquad_bert_ent_and_type.json",
"in": ["x"],
Expand All @@ -26,7 +31,7 @@
{
"class_name": "template_matcher",
"id": "template_m",
"num_processors": 8,
"num_processors": 16,
"load_path": "{DOWNLOADS_PATH}/wikidata_eng",
"templates_filename": "templates_eng.json"
},
Expand All @@ -42,6 +47,7 @@
"inverted_index_filename": "inverted_index_eng.pickle",
"entities_list_filename": "entities_list.pickle",
"q2name_filename": "wiki_eng_q_to_name.pickle",
"who_entities_filename": "who_entities.pickle",
"build_inverted_index": false,
"use_descriptions": false,
"use_prefix_tree": false
Expand Down Expand Up @@ -79,7 +85,7 @@
"sparql_queries_filename": "{DOWNLOADS_PATH}/wikidata/sparql_queries.json",
"entities_to_leave": 5,
"rels_to_leave": 10,
"in": ["x", "template_type", "entities", "types"],
"in": ["x", "x", "template_type", "entities", "types"],
"out": ["candidate_answers"]
},
{
Expand Down Expand Up @@ -156,7 +162,7 @@
},
{
"url": "http://files.deeppavlov.ai/kbqa/models/ner_lcquad.tar.gz",
"subdir": "{MODELS_PATH}/ner_lcquad"
"subdir": "{MODELS_PATH}/ner_lcquad_ent_and_type"
},
{
"url": "http://files.deeppavlov.ai/kbqa/models/rel_ranking.tar.gz",
Expand Down
2 changes: 1 addition & 1 deletion deeppavlov/configs/kbqa/kbqa_cq_bert_ranker.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"entities_to_leave": 5,
"rels_to_leave": 12,
"return_answers": true,
"in": ["x", "template_type", "entities", "types"],
"in": ["x", "x", "template_type", "entities", "types"],
"out": ["answers"]
}
],
Expand Down
2 changes: 1 addition & 1 deletion deeppavlov/configs/kbqa/kbqa_cq_mt_bert.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"sparql_queries_filename": "{DOWNLOADS_PATH}/wikidata_eng/sparql_queries.json",
"entities_to_leave": 5,
"rels_to_leave": 10,
"in": ["x", "template_type", "entities", "types"],
"in": ["x", "x", "template_type", "entities", "types"],
"out": ["candidate_rels_answers"]
},
{
Expand Down
4 changes: 2 additions & 2 deletions deeppavlov/configs/kbqa/kbqa_cq_online.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"sparql_queries_filename": "{DOWNLOADS_PATH}/wikidata/sparql_queries.json",
"entities_to_leave": 5,
"rels_to_leave": 10,
"in": ["x", "template_type", "entities", "types"],
"in": ["x", "x", "template_type", "entities", "types"],
"out": ["candidate_answers"]
},
{
Expand Down Expand Up @@ -155,7 +155,7 @@
},
{
"url": "http://files.deeppavlov.ai/kbqa/models/ner_lcquad.tar.gz",
"subdir": "{MODELS_PATH}/ner_lcquad"
"subdir": "{MODELS_PATH}/ner_lcquad_ent_and_type"
},
{
"url": "http://files.deeppavlov.ai/kbqa/models/rel_ranking.tar.gz",
Expand Down
2 changes: 1 addition & 1 deletion deeppavlov/configs/kbqa/kbqa_cq_online_mt_bert.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"sparql_queries_filename": "{DOWNLOADS_PATH}/wikidata_eng/sparql_queries.json",
"entities_to_leave": 5,
"rels_to_leave": 10,
"in": ["x", "template_type", "entities", "types"],
"in": ["x", "x", "template_type", "entities", "types"],
"out": ["candidate_rels_answers"]
},
{
Expand Down
26 changes: 24 additions & 2 deletions deeppavlov/configs/kbqa/kbqa_cq_rus.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@
"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"]
},
Expand All @@ -42,16 +49,27 @@
"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": false,
"use_descriptions": true,
"include_mention": false,
"use_prefix_tree": false
},
{
Expand Down Expand Up @@ -91,7 +109,7 @@
"rels_to_leave": 10,
"return_answers": true,
"syntax_structure_known": true,
"in": ["x_sanitized", "query_nums", "entities_dict", "types_dict"],
"in": ["x", "x_sanitized", "query_nums", "entities_dict", "types_dict"],
"out": ["answers"]
}
],
Expand Down Expand Up @@ -157,6 +175,10 @@
"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"
Expand Down
4 changes: 2 additions & 2 deletions deeppavlov/configs/nemo/asr.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"NEMO_PATH": "~/.deeppavlov/models/nemo"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/pytorch.txt",
"{DEEPPAVLOV_PATH}/requirements/nemo-pytorch.txt",
"{DEEPPAVLOV_PATH}/requirements/nemo-asr.txt"
],
"download": [
Expand All @@ -27,4 +27,4 @@
}
]
}
}
}
4 changes: 2 additions & 2 deletions deeppavlov/configs/nemo/asr_tts.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"TTS_PATH": "{NEMO_PATH}/tacotron2_waveglow"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/pytorch.txt",
"{DEEPPAVLOV_PATH}/requirements/nemo-pytorch.txt",
"{DEEPPAVLOV_PATH}/requirements/nemo-asr.txt",
"{DEEPPAVLOV_PATH}/requirements/nemo-tts.txt"
],
Expand All @@ -50,4 +50,4 @@
}
]
}
}
}
Loading

0 comments on commit b66179e

Please sign in to comment.