/
ner_rus.json
181 lines (178 loc) · 4.46 KB
/
ner_rus.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
172
173
174
175
176
177
178
179
180
181
{
"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": [
{
"in": ["x"],
"class_name": "lazy_tokenizer",
"out": ["x_tokens"]
},
{
"in": ["x_tokens"],
"class_name": "str_lower",
"out": ["x_lower"]
},
{
"in": ["x_lower"],
"class_name": "sanitizer",
"nums": true,
"out": ["x_san"]
},
{
"in": ["x_san"],
"id": "word_vocab",
"class_name": "simple_vocab",
"pad_with_zeros": true,
"special_tokens": ["<UNK>"],
"fit_on": ["x_san"],
"save_path": "{NER_PATH}/word.dict",
"load_path": "{NER_PATH}/word.dict",
"out": ["x_tok_ind"]
},
{
"in": ["y"],
"id": "tag_vocab",
"class_name": "simple_vocab",
"pad_with_zeros": true,
"fit_on": ["y"],
"save_path": "{NER_PATH}/tag.dict",
"load_path": "{NER_PATH}/tag.dict",
"out": ["y_ind"]
},
{
"in": ["x_tokens"],
"class_name": "char_splitter",
"out": ["x_char"]
},
{
"in": ["x_char"],
"id": "char_vocab",
"class_name": "simple_vocab",
"pad_with_zeros": true,
"fit_on": ["x_char"],
"save_path": "{NER_PATH}/char.dict",
"load_path": "{NER_PATH}/char.dict",
"out": ["x_char_ind"]
},
{
"in": ["x_san"],
"id": "embedder",
"class_name": "fasttext",
"pad_zero": true,
"load_path": "{DOWNLOADS_PATH}/embeddings/lenta_lower_100.bin",
"out": ["x_emb"]
},
{
"in": ["x_tokens"],
"class_name": "mask",
"out": ["mask"]
},
{
"class_name": "random_emb_mat",
"id": "embeddings",
"vocab_len": "#word_vocab.len",
"emb_dim": 100
},
{
"class_name": "random_emb_mat",
"id": "embeddings_char",
"vocab_len": "#char_vocab.len",
"emb_dim": 100
},
{
"id": "capitalization",
"class_name": "capitalization_featurizer",
"in": ["x_tokens"],
"out": ["cap"]
},
{
"in": ["x_emb", "mask", "x_char_ind", "cap"],
"in_y": ["y_ind"],
"out": ["y_predicted"],
"class_name": "ner",
"main": true,
"n_hidden_list": [128],
"net_type": "rnn",
"cell_type": "lstm",
"use_cudnn_rnn": true,
"n_tags": "#tag_vocab.len",
"capitalization_dim": "#capitalization.dim",
"token_emb_dim": "#embedder.dim",
"char_emb_dim": 100,
"save_path": "{NER_PATH}/model",
"load_path": "{NER_PATH}/model",
"char_emb_mat": "#embeddings_char.emb_mat",
"use_crf": true,
"use_batch_norm": true,
"embeddings_dropout": true,
"top_dropout": true,
"intra_layer_dropout": true,
"l2_reg": 0,
"learning_rate": 1e-2,
"dropout_keep_prob": 0.7
},
{
"ref": "tag_vocab",
"in": ["y_predicted"],
"out": ["tags"]
}
],
"out": ["x_tokens", "tags"]
},
"train": {
"epochs": 100,
"batch_size": 64,
"metrics": [
{
"name": "ner_f1",
"inputs": ["y", "tags"]
},
{
"name": "ner_token_f1",
"inputs": ["y", "tags"]
}
],
"validation_patience": 7,
"val_every_n_epochs": 1,
"log_every_n_epochs": 1,
"show_examples": false,
"tensorboard_log_dir": "{NER_PATH}/logs",
"class_name": "nn_trainer",
"evaluation_targets": [
"valid",
"test"
]
},
"metadata": {
"variables": {
"ROOT_PATH": "~/.deeppavlov",
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
"MODELS_PATH": "{ROOT_PATH}/models",
"NER_PATH": "{MODELS_PATH}/ner_rus"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/fasttext.txt",
"{DEEPPAVLOV_PATH}/requirements/tf.txt"
],
"download": [
{
"url": "http://files.deeppavlov.ai/deeppavlov_data/ner_rus_v3_cpu_compatible.tar.gz",
"subdir": "{MODELS_PATH}"
},
{
"url": "http://files.deeppavlov.ai/embeddings/lenta_lower_100.bin",
"subdir": "{DOWNLOADS_PATH}/embeddings"
}
]
}
}