Skip to content
Permalink
Browse files

add dependency parser config (#2639)

fixes #2445
  • Loading branch information...
DeNeutoy committed Mar 26, 2019
1 parent 305bd35 commit e79b713d46f56c308b017101de99880cfbfdbcb9
Showing with 67 additions and 0 deletions.
  1. +3 −0 allennlp/tests/common/params_test.py
  2. +64 −0 training_config/dependency_parser.json
@@ -206,6 +206,9 @@ def test_known_configs(self):
# constituency parser
'PTB_TRAIN_PATH', 'PTB_DEV_PATH', 'PTB_TEST_PATH',

# dependency parser
'PTB_DEPENDENCIES_TRAIN', 'PTB_DEPENDENCIES_VAL',

# srl_elmo_5.5B
'SRL_TRAIN_DATA_PATH', 'SRL_VALIDATION_DATA_PATH',

@@ -0,0 +1,64 @@
{
"dataset_reader":{
"type":"universal_dependencies"
},
"train_data_path": std.extVar("PTB_DEPENDENCIES_TRAIN"),
"validation_data_path": std.extVar("PTB_DEPENDENCIES_VAL"),
"model": {
"type": "biaffine_parser",
"text_field_embedder": {
"tokens": {
"type": "embedding",
"embedding_dim": 100,
"pretrained_file": "https://s3-us-west-2.amazonaws.com/allennlp/datasets/glove/glove.6B.100d.txt.gz",
"trainable": true,
"sparse": true
}
},
"pos_tag_embedding":{
"embedding_dim": 100,
"vocab_namespace": "pos",
"sparse": true
},
"encoder": {
"type": "stacked_bidirectional_lstm",
"input_size": 200,
"hidden_size": 400,
"num_layers": 3,
"recurrent_dropout_probability": 0.3,
"use_highway": true
},
"use_mst_decoding_for_validation": false,
"arc_representation_dim": 500,
"tag_representation_dim": 100,
"dropout": 0.3,
"input_dropout": 0.3,
"initializer": [
[".*projection.*weight", {"type": "xavier_uniform"}],
[".*projection.*bias", {"type": "zero"}],
[".*tag_bilinear.*weight", {"type": "xavier_uniform"}],
[".*tag_bilinear.*bias", {"type": "zero"}],
[".*weight_ih.*", {"type": "xavier_uniform"}],
[".*weight_hh.*", {"type": "orthogonal"}],
[".*bias_ih.*", {"type": "zero"}],
[".*bias_hh.*", {"type": "lstm_hidden_bias"}]]
},

"iterator": {
"type": "bucket",
"sorting_keys": [["words", "num_tokens"]],
"batch_size" : 128
},
"trainer": {
"num_epochs": 50,
"grad_norm": 5.0,
"patience": 50,
"cuda_device": 0,
"validation_metric": "+LAS",
"optimizer": {
"type": "dense_sparse_adam",
"betas": [0.9, 0.9]
}
}
}

0 comments on commit e79b713

Please sign in to comment.
You can’t perform that action at this time.