BertSquadQAModel.ConfigΒΆ
Component: BertSquadQAModel
-
class
BertSquadQAModel.
Config
[source] Bases:
NewBertModel.Config
All Attributes (including base classes)
- inputs: ModelInput = ModelInput()
- encoder: TransformerSentenceEncoderBase.Config = HuggingFaceBertSentenceEncoder.Config()
- decoder: MLPDecoder.Config = MLPDecoder.Config()
- output_layer: SquadOutputLayer.Config = SquadOutputLayer.Config()
- pos_decoder: MLPDecoder.Config = MLPDecoder.Config(out_dim=
2
)- has_ans_decoder: MLPDecoder.Config = MLPDecoder.Config(out_dim=
2
)- is_kd: bool =
False
Default JSON
{
"inputs": {
"squad_input": {
"SquadForBERTTensorizer": {
"is_input": true,
"columns": [
"question",
"doc"
],
"tokenizer": {
"WordPieceTokenizer": {
"basic_tokenizer": {
"split_regex": "\\s+",
"lowercase": true
},
"wordpiece_vocab_path": "/mnt/vol/nlp_technologies/bert/uncased_L-12_H-768_A-12/vocab.txt"
}
},
"base_tokenizer": null,
"vocab_file": "/mnt/vol/nlp_technologies/bert/uncased_L-12_H-768_A-12/vocab.txt",
"max_seq_len": 256,
"answers_column": "answers",
"answer_starts_column": "answer_starts"
}
},
"has_answer": {
"LabelTensorizer": {
"is_input": false,
"column": "has_answer",
"allow_unknown": false,
"pad_in_vocab": false,
"label_vocab": null
}
}
},
"encoder": {
"HuggingFaceBertSentenceEncoder": {
"load_path": null,
"save_path": null,
"freeze": false,
"shared_module_key": null,
"output_dropout": 0.4,
"embedding_dim": 768,
"pooling": "cls_token",
"export": false,
"bert_cpt_dir": "/mnt/vol/nlp_technologies/bert/uncased_L-12_H-768_A-12/",
"load_weights": true
}
},
"decoder": {
"load_path": null,
"save_path": null,
"freeze": false,
"shared_module_key": null,
"hidden_dims": [],
"out_dim": null,
"layer_norm": false,
"dropout": 0.0,
"activation": "relu"
},
"output_layer": {
"load_path": null,
"save_path": null,
"freeze": false,
"shared_module_key": null,
"loss": {
"CrossEntropyLoss": {}
},
"ignore_impossible": true,
"pos_loss_weight": 0.5,
"has_answer_loss_weight": 0.5,
"false_label": "False",
"max_answer_len": 30,
"hard_weight": 0.0
},
"pos_decoder": {
"load_path": null,
"save_path": null,
"freeze": false,
"shared_module_key": null,
"hidden_dims": [],
"out_dim": 2,
"layer_norm": false,
"dropout": 0.0,
"activation": "relu"
},
"has_ans_decoder": {
"load_path": null,
"save_path": null,
"freeze": false,
"shared_module_key": null,
"hidden_dims": [],
"out_dim": 2,
"layer_norm": false,
"dropout": 0.0,
"activation": "relu"
},
"is_kd": false
}