PyTorch
File size: 3,970 Bytes
a12b352
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
{
    "experiment": "ota_boun",
    "name": "bert-base-turkish-cased",
    "n_gpu": 1,
    "model": {
        "type": "MultiParser",
        "args": {
            "embeddings_processor": {
                "type": "BertWrapper",
                "args": {
                    "model_path": "data/pretrained_embeddings/bert-base-turkish-cased-nonpretrained",
                    "fine_tune": true,
                    "hidden_dropout": 0.2,
                    "attn_dropout": 0.2,
                    "output_dropout": 0.5,
                    "scalar_mix_layer_dropout": 0.1,
                    "token_mask_prob": 0.15
                }
            },
            "outputs": {
                "heads": {
                    "type": "ArcScorer",
                    "args": {
                        "scorer_class": "DeepBiaffineScorer",
                        "head_mode": "single_head",
                        "hidden_size": 768,
                        "dropout": 0.33,
                        "vocab": {
                            "type": "IntegerVocab"
                        }
                    }
                },
                "labels": {
                    "type": "DependencyClassifier",
                    "args": {
                        "scorer_class": "DeepBiaffineScorer",
                        "hidden_size": 256,
                        "dropout": 0.33,
                        "vocab": {
                            "type": "BasicVocab",
                            "args": {
                                "vocab_filename": "data/corpora/ota_boun/vocab/basic.vocab"
                            }
                        }
                    }
                }
            },
            "post_processors": [
                {
                    "type": "FactorizedMSTPostProcessor",
                    "args": {
                        "annotation_ids": [
                            "heads",
                            "labels"
                        ]
                    }
                }
            ]
        }
    },
    "data_loaders": {
        "type": "BucketedCONLLLoader",
        "args": {
            "annotation_layers": {
                "heads": {
                    "type": "TagSequence",
                    "source_column": 6,
                    "args": {
                        "ignore_root": true
                    }
                },
                "labels": {
                    "type": "DependencyMatrix",
                    "source_column": [
                        6,
                        7
                    ],
                    "args": {
                        "ignore_non_relations": true
                    }
                }
            },
            "batch_size": 32,
            "bucket_size": 256,
            "max_tokens_per_batch": 156800,
            "num_workers": 2
        },
        "paths": {
            "train": "data/corpora/ota_boun/ota_boun-ud-train.conllu",
            "dev": "data/corpora/ota_boun/ota_boun-ud-test.conllu",
            "test": "data/corpora/ota_boun/tr_boun-ud-test.conllu"
        }
    },
    "trainer": {
        "min_epochs": 15,
        "max_epochs": 300,
        "early_stop": 15,
        "save_dir": "data/saved_models/",
        "save_period": 20,
        "verbosity": 2,
        "validation_criterion": {
            "metrics": {
                "heads": "fscore",
                "labels": "fscore"
            },
            "weighting": "multiplicative"
        },
        "optimizer": {
            "type": "AdamW",
            "args": {
                "lr": 4e-05,
                "weight_decay": 0.0
            }
        },
        "lr_scheduler": {
            "type": "LambdaLR",
            "args": {
                "lr_lambda": "SqrtSchedule(400)"
            }
        },
        "loss": {
            "type": "CrossEntropyLoss",
            "args": {
                "ignore_index": -1
            }
        }
    }
}