BertPairwiseModel.ConfigΒΆ
Component: BertPairwiseModel
-
class
BertPairwiseModel.
Config
[source] Bases:
BasePairwiseModel.Config
All Attributes (including base classes)
- inputs: ModelInput = ModelInput()
- decoder: Optional[MLPDecoder.Config] = MLPDecoder.Config()
- output_layer: Union[ClassificationOutputLayer.Config, PairwiseCosineDistanceOutputLayer.Config] = ClassificationOutputLayer.Config()
- encode_relations: bool =
True
- encoder: TransformerSentenceEncoderBase.Config = HuggingFaceBertSentenceEncoder.Config()
- shared_encoder: bool =
True
Default JSON
{
"inputs": {
"tokens1": {
"BERTTensorizer": {
"is_input": true,
"columns": [
"text1"
],
"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": 128
}
},
"tokens2": {
"BERTTensorizer": {
"is_input": true,
"columns": [
"text2"
],
"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": 128
}
},
"labels": {
"LabelTensorizer": {
"is_input": false,
"column": "label",
"allow_unknown": false,
"pad_in_vocab": false,
"label_vocab": null
}
},
"num_tokens": {
"is_input": false,
"names": [
"tokens1",
"tokens2"
],
"indexes": [
2,
2
]
}
},
"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": {
"ClassificationOutputLayer": {
"load_path": null,
"save_path": null,
"freeze": false,
"shared_module_key": null,
"loss": {
"CrossEntropyLoss": {}
},
"label_weights": null
}
},
"encode_relations": true,
"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
}
},
"shared_encoder": true
}