forked from allenai/allennlp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathner.jsonnet
77 lines (77 loc) · 2.03 KB
/
ner.jsonnet
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
// Configuration for a named entity recognization model based on:
// Peters, Matthew E. et al. “Deep contextualized word representations.” NAACL-HLT (2018).
{
"dataset_reader": {
"type": "conll2003",
"tag_label": "ner",
"coding_scheme": "BIOUL",
"token_indexers": {
"tokens": {
"type": "single_id",
"lowercase_tokens": true
},
"token_characters": {
"type": "characters",
"min_padding_length": 3
}
}
},
"train_data_path": std.extVar("NER_TRAIN_DATA_PATH"),
"validation_data_path": std.extVar("NER_TEST_A_PATH"),
"test_data_path": std.extVar("NER_TEST_B_PATH"),
"model": {
"type": "crf_tagger",
"label_encoding": "BIOUL",
"constrain_crf_decoding": true,
"calculate_span_f1": true,
"dropout": 0.5,
"include_start_end_transitions": false,
"text_field_embedder": {
"token_embedders": {
"tokens": {
"type": "embedding",
"embedding_dim": 50,
"pretrained_file": "https://s3-us-west-2.amazonaws.com/allennlp/datasets/glove/glove.6B.50d.txt.gz",
"trainable": true
},
"token_characters": {
"type": "character_encoding",
"embedding": {
"embedding_dim": 16
},
"encoder": {
"type": "cnn",
"embedding_dim": 16,
"num_filters": 128,
"ngram_filter_sizes": [3],
"conv_layer_activation": "relu"
}
}
},
},
"encoder": {
"type": "lstm",
"input_size": 50 + 128,
"hidden_size": 200,
"num_layers": 2,
"dropout": 0.5,
"bidirectional": true
},
},
"iterator": {
"type": "basic",
"batch_size": 64
},
"trainer": {
"optimizer": {
"type": "adam",
"lr": 0.001
},
"validation_metric": "+f1-measure-overall",
"num_serialized_models_to_keep": 3,
"num_epochs": 75,
"grad_norm": 5.0,
"patience": 25,
"cuda_device": 0
}
}