Skip to content

Commit

Permalink
Replace tf squad with pytorch configs (#1539)
Browse files Browse the repository at this point in the history
* replace tf squad with torch

* fixes

* infer in call method

* update redundant configs

* reformat, update config names in odqa

* fix config names in tests

* refactor

* update configs parameters

* update squad configs in tests

* refactor

* add score from 0 to 1

* fix docs

* update tests

* fix docs

* Update squad_ru_bert.json

* fix multi-gpu inference

* fix multi-gpu inference

* fix squad training

* odqa fixes

* refactor

* refactor: import order

* refactor: squad_preprocessor imports

* refactor

* update config names

* remove redundant squad configs

* update docs

* fix: removed unexisting configs from test_quick_start

* feat: squad aliases

* loading in base class

* refactor

* fix torch model

* remove lang

* remove lang

* refactor: removed redundand newlines in two configs

* remove strict load flag

* rename configs, add squad2 config

* update docs, remove redundant config

* feat: instafail

* replace checkpoints with old transformers version with new checkpoints

* rename configs

* refactor: docs and redundant requirements

* add sent_tokenize

Co-authored-by: Fedor Ignatov <ignatov.fedor@gmail.com>
  • Loading branch information
dmitrijeuseew and IgnatovFedor committed May 5, 2022
1 parent 163420b commit 602334d
Show file tree
Hide file tree
Showing 63 changed files with 561 additions and 3,793 deletions.
2 changes: 1 addition & 1 deletion deeppavlov/configs/classifiers/insults_kaggle_bert.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"subdir": "{DOWNLOADS_PATH}"
},
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/classifiers/insults_kaggle_torch_bert_v0.tar.gz",
"url": "http://files.deeppavlov.ai/deeppavlov_data/classifiers/insults_kaggle_torch_bert_v5.tar.gz",
"subdir": "{MODELS_PATH}/classifiers"
}
]
Expand Down
2 changes: 1 addition & 1 deletion deeppavlov/configs/odqa/en_odqa_infer_wiki.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{
"class_name": "logit_ranker",
"batch_size": 64,
"squad_model": {"config_path": "{CONFIGS_PATH}/squad/multi_squad_noans_infer.json"},
"squad_model": {"config_path": "{CONFIGS_PATH}/squad/qa_squad2_bert.json"},
"sort_noans": true,
"in": ["chunks", "questions"],
"out": ["answer", "answer_score", "answer_place"]
Expand Down
4 changes: 2 additions & 2 deletions deeppavlov/configs/odqa/en_odqa_pop_infer_enwiki20180211.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"class_name": "logit_ranker",
"batch_size": 10,
"squad_model": {
"config_path": "{CONFIGS_PATH}/squad/multi_squad_noans_infer.json"
"config_path": "{CONFIGS_PATH}/squad/qa_squad2_bert.json"
},
"sort_noans": true,
"in": [
Expand Down Expand Up @@ -78,4 +78,4 @@
"download": [
]
}
}
}
2 changes: 1 addition & 1 deletion deeppavlov/configs/odqa/ru_odqa_infer_wiki.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
{
"class_name": "logit_ranker",
"batch_size": 10,
"squad_model": {"config_path": "{CONFIGS_PATH}/squad/squad_ru.json"},
"squad_model": {"config_path": "{CONFIGS_PATH}/squad/squad_ru_bert.json"},
"sort_noans": true,
"in": [
"chunks",
Expand Down
2 changes: 1 addition & 1 deletion deeppavlov/configs/odqa/ru_odqa_infer_wiki_retr_noans.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
{
"class_name": "logit_ranker",
"batch_size": 10,
"squad_model": {"config_path": "{CONFIGS_PATH}/squad/multi_squad_ru_retr_noans.json"},
"squad_model": {"config_path": "{CONFIGS_PATH}/squad/qa_multisberquad_bert.json"},
"sort_noans": true,
"in": [
"chunks",
Expand Down
70 changes: 0 additions & 70 deletions deeppavlov/configs/odqa/ru_odqa_infer_wiki_rubert.json

This file was deleted.

70 changes: 0 additions & 70 deletions deeppavlov/configs/odqa/ru_odqa_infer_wiki_rubert_noans.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"subdir": "{DOWNLOADS_PATH}/ubuntu_v2_data"
},
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/ubuntu_v2_uncased_torch_bert_model_v0.tar.gz",
"url": "http://files.deeppavlov.ai/deeppavlov_data/ubuntu_v2_uncased_torch_bert_model_v2.tar.gz",
"subdir": "{MODELS_PATH}"
}
]
Expand Down
10 changes: 5 additions & 5 deletions deeppavlov/configs/relation_extraction/re_docred.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"in": ["tokens", "entity_pos", "entity_tags"],
"out": ["input_ids", "attention_mask", "upd_entity_pos", "upd_entity_tags", "nf_samples"],
"class_name": "re_preprocessor",
"vocab_file": "bert-base-uncased",
"vocab_file": "bert-base-cased",
"default_tag": "PER"
},
{
Expand All @@ -30,7 +30,7 @@
"model_name": "re_model",
"n_classes": 97,
"num_ner_tags": 6,
"pretrained_bert": "bert-base-uncased",
"pretrained_bert": "bert-base-cased",
"return_probas": true
},
{
Expand All @@ -45,13 +45,13 @@
},
"train": {
"epochs": 50,
"batch_size": 16,
"batch_size": 30,
"log_every_n_batches": 100,
"train_metrics": ["f1_weighted", "acc"],
"evaluation_targets": ["valid", "train"],
"metrics": ["f1_weighted", "acc"],
"validation_patience": 50,
"val_every_n_batches": 100,
"val_every_n_batches": 200,
"show_examples": false,
"class_name": "torch_trainer"
},
Expand All @@ -68,7 +68,7 @@
"subdir": "{DOWNLOADS_PATH}/docred"
},
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/relation_extraction/re_docred_model.tar.gz",
"url": "http://files.deeppavlov.ai/deeppavlov_data/relation_extraction/re_docred_model_v1.tar.gz",
"subdir": "{MODELS_PATH}/re_docred"
},
{
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 @@ -70,7 +70,7 @@
"subdir": "{DOWNLOADS_PATH}/rured"
},
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/relation_extraction/re_rured_model.tar.gz",
"url": "http://files.deeppavlov.ai/deeppavlov_data/relation_extraction/re_rured_model_v1.tar.gz",
"subdir": "{MODELS_PATH}/re_rured"
}
]
Expand Down

0 comments on commit 602334d

Please sign in to comment.