-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1313 from deepmipt/dev
Release 0.12.1
- Loading branch information
Showing
44 changed files
with
935 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
deeppavlov/configs/classifiers/entity_ranking_bert_eng_no_mention.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.