-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
morpho_ru_syntagrus_bert.json
171 lines (170 loc) · 4.41 KB
/
morpho_ru_syntagrus_bert.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
{
"dataset_reader": {
"class_name": "morphotagger_dataset_reader",
"data_path": "{DOWNLOADS_PATH}/UD2.3_source",
"language": "ru_syntagrus",
"data_types": [
"train", "dev", "test"
]
},
"dataset_iterator": {
"class_name": "morphotagger_dataset"
},
"chainer": {
"in": ["x"],
"in_y": ["y"],
"pipe": [
{
"in": [
"x"
],
"class_name": "lazy_tokenizer",
"out": [
"x_words"
]
},
{
"class_name": "bert_ner_preprocessor",
"vocab_file": "{BERT_PATH}/vocab.txt",
"do_lower_case": false,
"max_seq_length": 512,
"max_subword_length": 15,
"subword_mask_mode": "last",
"token_masking_prob": 0.0,
"in": ["x_words"],
"out": ["x_tokens", "x_subword_tokens", "x_subword_tok_ids", "startofword_markers", "attention_mask"]
},
{
"id": "tag_vocab",
"class_name": "simple_vocab",
"min_freq": 3,
"fit_on": [
"y"
],
"in": ["y"],
"out": ["y_ind"],
"special_tokens": [
"PAD",
"BEGIN",
"END"
],
"pad_with_zeros": true,
"save_path": "{WORK_PATH}/tag.dict",
"load_path": "{WORK_PATH}/tag.dict"
},
{
"class_name": "bert_sequence_tagger",
"n_tags": "#tag_vocab.len",
"keep_prob": 0.1,
"bert_config_file": "{BERT_PATH}/bert_config.json",
"pretrained_bert": "{BERT_PATH}/bert_model.ckpt",
"attention_probs_keep_prob": 0.5,
"use_crf": false,
"return_probas": false,
"encoder_layer_ids": [6, 7, 8, 9, 10, 11],
"optimizer": "tf.train:AdamOptimizer",
"learning_rate": 1e-3,
"bert_learning_rate": 2e-5,
"min_learning_rate": 1e-7,
"learning_rate_drop_patience": 30,
"learning_rate_drop_div": 1.5,
"load_before_drop": true,
"clip_norm": null,
"save_path": "{WORK_PATH}/model",
"load_path": "{WORK_PATH}/model",
"in": ["x_subword_tok_ids", "attention_mask", "startofword_markers"],
"in_y": ["y_ind"],
"out": ["y_predicted_ind"]
},
{
"ref": "tag_vocab",
"in": ["y_predicted_ind"],
"out": ["y_predicted"]
},
{
"in": [
"x_words",
"y_predicted"
],
"out": [
"y_lemmas"
],
"class_name": "UD_pymorphy_lemmatizer",
"end": "\n"
},
{
"in": [
"x_words",
"y_predicted",
"y_lemmas"
],
"out": [
"y_prettified"
],
"id": "prettifier",
"class_name": "lemmatized_output_prettifier",
"end": "\n"
}
],
"out": [
"y_prettified"
]
},
"train": {
"epochs": 10,
"batch_size": 32,
"metrics": [
{
"name": "per_token_accuracy",
"inputs": [
"y",
"y_predicted"
]
},
{
"name": "accuracy",
"inputs": [
"y",
"y_predicted"
]
}
],
"validation_patience": 10,
"val_every_n_epochs": 1,
"val_every_n_batches": 300,
"tensorboard_log_dir": "{WORK_PATH}/logs",
"show_examples": false,
"pytest_max_batches": 2,
"pytest_batch_size": 8,
"evaluation_targets": ["valid", "test"],
"class_name": "nn_trainer"
},
"metadata": {
"variables": {
"ROOT_PATH": "~/.deeppavlov",
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
"MODELS_PATH": "{ROOT_PATH}/models",
"BERT_PATH": "{DOWNLOADS_PATH}/bert_models/rubert_cased_L-12_H-768_A-12_v1",
"WORK_PATH": "{MODELS_PATH}/morpho_ru_syntagrus"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/tf.txt",
"{DEEPPAVLOV_PATH}/requirements/bert_dp.txt",
"{DEEPPAVLOV_PATH}/requirements/morpho_tagger.txt"
],
"download": [
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/morpho_tagger/BERT/morpho_ru_syntagrus_bert.tar.gz",
"subdir": "{WORK_PATH}"
},
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/bert/rubert_cased_L-12_H-768_A-12_v1.tar.gz",
"subdir": "{DOWNLOADS_PATH}/bert_models"
},
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/morpho_tagger/UD2.3/ru_syntagrus.tar.gz",
"subdir": "{DOWNLOADS_PATH}/UD2.3_source/ru_syntagrus"
}
]
}
}