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,
"use_byte_offsets": false
},
"wordpiece_vocab_path": "manifold://nlp_technologies/tree/huggingface-models/bert-base-uncased/vocab.txt"
}
},
"base_tokenizer": null,
"vocab_file": "manifold://nlp_technologies/tree/huggingface-models/bert-base-uncased/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,
"label_vocab_file": null,
"add_labels": 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,
"projection_dim": 0,
"normalize_output_rep": false,
"bert_cpt_dir": "manifold://nlp_technologies/tree/huggingface-models/bert-base-uncased/",
"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,
"bias": true,
"activation": "relu",
"temperature": 1.0,
"spectral_normalization": false
},
"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,
"bias": true,
"activation": "relu",
"temperature": 1.0,
"spectral_normalization": false
},
"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,
"bias": true,
"activation": "relu",
"temperature": 1.0,
"spectral_normalization": false
},
"is_kd": false
}