-
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.
* Update config * Add automodel * Modify NER config * Add Russian NER config * Add upload script * Add torch sequence tagger * Modify sequence tagger * refactor: small refactor * fix: classes names in docs * fix: token_from_subtoken path in docs * Fix docs * feat: updated requirements Co-authored-by: Fedor Ignatov <[email protected]>
- Loading branch information
1 parent
5fde446
commit c66cbbf
Showing
11 changed files
with
252 additions
and
45 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
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,155 @@ | ||
{ | ||
"dataset_reader": { | ||
"class_name": "conll2003_reader", | ||
"data_path": "{DOWNLOADS_PATH}/total_rus/", | ||
"dataset_name": "collection_rus", | ||
"provide_pos": false | ||
}, | ||
"dataset_iterator": { | ||
"class_name": "data_learning_iterator" | ||
}, | ||
"chainer": { | ||
"in": [ | ||
"x" | ||
], | ||
"in_y": [ | ||
"y" | ||
], | ||
"pipe": [ | ||
{ | ||
"class_name": "torch_transformers_ner_preprocessor", | ||
"vocab_file": "{TRANSFORMER}", | ||
"do_lower_case": false, | ||
"max_seq_length": 512, | ||
"max_subword_length": 15, | ||
"token_masking_prob": 0.0, | ||
"in": [ | ||
"x" | ||
], | ||
"out": [ | ||
"x_tokens", | ||
"x_subword_tokens", | ||
"x_subword_tok_ids", | ||
"startofword_markers", | ||
"attention_mask" | ||
] | ||
}, | ||
{ | ||
"id": "tag_vocab", | ||
"class_name": "simple_vocab", | ||
"unk_token": [ | ||
"O" | ||
], | ||
"pad_with_zeros": true, | ||
"save_path": "{MODEL_PATH}/tag.dict", | ||
"load_path": "{MODEL_PATH}/tag.dict", | ||
"fit_on": [ | ||
"y" | ||
], | ||
"in": [ | ||
"y" | ||
], | ||
"out": [ | ||
"y_ind" | ||
] | ||
}, | ||
{ | ||
"class_name": "torch_transformers_sequence_tagger", | ||
"n_tags": "#tag_vocab.len", | ||
"pretrained_bert": "{TRANSFORMER}", | ||
"attention_probs_keep_prob": 0.5, | ||
"return_probas": false, | ||
"encoder_layer_ids": [ | ||
-1 | ||
], | ||
"optimizer": "AdamW", | ||
"optimizer_parameters": { | ||
"lr": 2e-5, | ||
"weight_decay": 1e-6, | ||
"betas": [ | ||
0.9, | ||
0.999 | ||
], | ||
"eps": 1e-6 | ||
}, | ||
"clip_norm": 1.0, | ||
"min_learning_rate": 1e-7, | ||
"learning_rate_drop_patience": 30, | ||
"learning_rate_drop_div": 1.5, | ||
"load_before_drop": true, | ||
"save_path": "{MODEL_PATH}/model", | ||
"load_path": "{MODEL_PATH}/model", | ||
"in": [ | ||
"x_subword_tok_ids", | ||
"attention_mask", | ||
"startofword_markers" | ||
], | ||
"in_y": [ | ||
"y_ind" | ||
], | ||
"out": [ | ||
"y_pred_ind" | ||
] | ||
}, | ||
{ | ||
"ref": "tag_vocab", | ||
"in": [ | ||
"y_pred_ind" | ||
], | ||
"out": [ | ||
"y_pred" | ||
] | ||
} | ||
], | ||
"out": [ | ||
"x_tokens", | ||
"y_pred" | ||
] | ||
}, | ||
"train": { | ||
"epochs": 30, | ||
"batch_size": 10, | ||
"metrics": [ | ||
{ | ||
"name": "ner_f1", | ||
"inputs": [ | ||
"y", | ||
"y_pred" | ||
] | ||
}, | ||
{ | ||
"name": "ner_token_f1", | ||
"inputs": [ | ||
"y", | ||
"y_pred" | ||
] | ||
} | ||
], | ||
"validation_patience": 100, | ||
"val_every_n_batches": 20, | ||
"log_every_n_batches": 20, | ||
"show_examples": false, | ||
"pytest_max_batches": 2, | ||
"pytest_batch_size": 8, | ||
"evaluation_targets": [ | ||
"valid", | ||
"test" | ||
], | ||
"class_name": "torch_trainer" | ||
}, | ||
"metadata": { | ||
"variables": { | ||
"ROOT_PATH": "~/.deeppavlov", | ||
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads", | ||
"MODELS_PATH": "{ROOT_PATH}/models", | ||
"TRANSFORMER": "DeepPavlov/rubert-base-cased", | ||
"MODEL_PATH": "{MODELS_PATH}/ner_rus_bert_torch" | ||
}, | ||
"download": [ | ||
{ | ||
"url": "http://files.deeppavlov.ai/v1/ner/ner_rus_bert_torch.tar.gz", | ||
"subdir": "{MODELS_PATH}" | ||
} | ||
] | ||
} | ||
} |
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.