Skip to content

Commit

Permalink
refactor: torch-based components (#1617)
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnatovFedor committed Jun 28, 2023
1 parent 1d216db commit 59b7557
Show file tree
Hide file tree
Showing 29 changed files with 301 additions and 1,418 deletions.
1 change: 0 additions & 1 deletion deeppavlov/configs/classifiers/rusentiment_bert.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"class_name": "torch_transformers_classifier",
"n_classes": "#classes_vocab.len",
"return_probas": true,
"one_hot_labels": true,
"pretrained_bert": "{TRANSFORMER}",
"save_path": "{MODEL_PATH}/model",
"load_path": "{MODEL_PATH}/model",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"class_name": "torch_transformers_classifier",
"n_classes": "#classes_vocab.len",
"return_probas": true,
"one_hot_labels": true,
"pretrained_bert": "{TRANSFORMER}",
"save_path": "{MODEL_PATH}/model",
"load_path": "{MODEL_PATH}/model",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"class_name": "torch_transformers_classifier",
"n_classes": "#classes_vocab.len",
"return_probas": true,
"one_hot_labels": true,
"pretrained_bert": "{TRANSFORMER}",
"save_path": "{MODEL_PATH}/model",
"load_path": "{MODEL_PATH}/model",
Expand Down
3 changes: 1 addition & 2 deletions deeppavlov/configs/classifiers/sentiment_twitter.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@
"lr": 0.0001,
"momentum": 0.9,
"weight_decay": 0.0001
},
"model_name": "cnn_model"
}
},
{
"in": "y_pred_probas",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
},
{
"class_name": "torch_transformers_classifier",
"one_hot_labels": true,
"n_classes": "#classes_vocab.len",
"return_probas": true,
"pretrained_bert": "{TRANSFORMER}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"entity_ranker": "#entity_descr_ranking",
"rank_in_runtime": true,
"num_entities_for_bert_ranking": 20,
"use_gpu": false,
"include_mention": false,
"num_entities_to_return": 3,
"lemmatize": true,
Expand Down
2 changes: 1 addition & 1 deletion deeppavlov/configs/faq/fasttext_logreg.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"subdir": "{DOWNLOADS_PATH}/massive/{LANGUAGE}"
},
{
"url": "https://files.deeppavlov.ai/faq/fasttext_logreg_{LANGUAGE}.tar.gz",
"url": "http://files.deeppavlov.ai/faq/fasttext_logreg_{LANGUAGE}.tar.gz",
"subdir": "{MODEL_PATH}"
}
]
Expand Down
4 changes: 2 additions & 2 deletions deeppavlov/configs/ranking/path_ranking_nll_roberta_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"load_path": "{MODEL_PATH}/model",
"encoder_save_path": "{MODEL_PATH}/encoder",
"linear_save_path": "{MODEL_PATH}/linear",
"model_name": "in_batch_ranking_model",
"pretrained_bert": "{TRANSFORMER}",
"learning_rate_drop_patience": 5,
"learning_rate_drop_div": 1.5
"learning_rate_drop_div": 1.5,
"optimizer_parameters": {"lr": 1e-5, "weight_decay": 0.01, "eps": 1e-6}
}
],
"out": ["model_output"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
},
{
"class_name": "torch_bert_ranker",
"one_hot_labels": false,
"pretrained_bert": "bert-base-uncased",
"save_path": "{MODEL_PATH}/model",
"load_path": "{MODEL_PATH}/model",
Expand All @@ -43,6 +42,7 @@
],
"eps": 1e-6
},
"clip_norm": 1.0,
"in": [
"bert_features"
],
Expand Down
4 changes: 2 additions & 2 deletions deeppavlov/configs/ranking/rel_ranking_nll_bert_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"load_path": "{MODEL_PATH}/model",
"encoder_save_path": "{MODEL_PATH}/encoder",
"linear_save_path": "{MODEL_PATH}/linear",
"model_name": "in_batch_ranking_model",
"pretrained_bert": "{TRANSFORMER}",
"learning_rate_drop_patience": 4,
"learning_rate_drop_div": 1.5
"learning_rate_drop_div": 1.5,
"optimizer_parameters": {"lr": 1e-5, "weight_decay": 0.01, "eps": 1e-6}
}
],
"out": ["model_output"]
Expand Down
2 changes: 1 addition & 1 deletion deeppavlov/configs/relation_extraction/re_docred.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"out": ["model_output"],
"save_path": "{MODEL_PATH}/model",
"load_path": "{MODEL_PATH}/model",
"model_name": "re_model",
"optimizer_parameters": {"lr": 5e-5, "weight_decay": 0.01, "eps": 1e-6},
"n_classes": 97,
"num_ner_tags": 6,
"pretrained_bert": "bert-base-cased",
Expand Down
2 changes: 1 addition & 1 deletion deeppavlov/configs/relation_extraction/re_rured.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"out": ["model_output"],
"save_path": "{MODEL_PATH}/model",
"load_path": "{MODEL_PATH}/model",
"model_name": "re_model",
"optimizer_parameters": {"lr": 5e-5, "weight_decay": 0.01, "eps": 1e-6},
"n_classes": 30,
"num_ner_tags": 29,
"pretrained_bert": "{TRANSFORMER}"
Expand Down

0 comments on commit 59b7557

Please sign in to comment.