bert_max_doc_str_max_str_pos_clean_doc_noise_doc/run_doc_qa.py
def build_model(self, mode, bert_config, use_one_hot_embeddings=False):
        """Builds the model based on BERT."""
        input_ids = tf.placeholder(
            tf.int64, name='input_ids', shape=[None, self.max_seq_length]
        )
        input_mask = tf.placeholder(
            tf.int64, name='input_mask', shape=[None, self.max_seq_length]
        )
        segment_ids = tf.placeholder(
            tf.int64, name="segment_ids", shape=[None, self.max_seq_length]
        )

        is_training = (mode == 'TRAIN')

        (start_logits, end_logits) = create_model(
            bert_config=bert_config,
            is_training=is_training,
            input_ids=input_ids,
            input_mask=input_mask,
            segment_ids=segment_ids,
            use_one_hot_embeddings=use_one_hot_embeddings
        )

        inputs = {
            'input_ids': input_ids,
            'input_mask': input_mask,
            'segment_ids': segment_ids,
        }

        outputs = {
            'start_logits': start_logits,
            'end_logits': end_logits,
        }

        return inputs, outputs
Builds the model based on BERT.
Builds the model based on BERT.
Builds the model based on BERT .
def build_model(self, mode, bert_config, use_one_hot_embeddings=False):
        input_ids = tf.placeholder(
            tf.int64, name='input_ids', shape=[None, self.max_seq_length]
        )
        input_mask = tf.placeholder(
            tf.int64, name='input_mask', shape=[None, self.max_seq_length]
        )
        segment_ids = tf.placeholder(
            tf.int64, name="segment_ids", shape=[None, self.max_seq_length]
        )
        is_training = (mode == 'TRAIN')
        (start_logits, end_logits) = create_model(
            bert_config=bert_config,
            is_training=is_training,
            input_ids=input_ids,
            input_mask=input_mask,
            segment_ids=segment_ids,
            use_one_hot_embeddings=use_one_hot_embeddings
        )
        inputs = {
            'input_ids': input_ids,
            'input_mask': input_mask,
            'segment_ids': segment_ids,
        }
        outputs = {
            'start_logits': start_logits,
            'end_logits': end_logits,
        }
        return inputs, outputs
def build_model ( self , mode , bert_config , use_one_hot_embeddings = False ) : input_ids = tf . placeholder ( tf . int64 , name = 'input_ids' , shape = [ None , self . max_seq_length ] ) input_mask = tf . placeholder ( tf . int64 , name = 'input_mask' , shape = [ None , self . max_seq_length ] ) segment_ids = tf . placeholder ( tf . int64 , name = "segment_ids" , shape = [ None , self . max_seq_length ] ) is_training = ( mode == 'TRAIN' ) ( start_logits , end_logits ) = create_model ( bert_config = bert_config , is_training = is_training , input_ids = input_ids , input_mask = input_mask , segment_ids = segment_ids , use_one_hot_embeddings = use_one_hot_embeddings ) inputs = { 'input_ids' : input_ids , 'input_mask' : input_mask , 'segment_ids' : segment_ids , } outputs = { 'start_logits' : start_logits , 'end_logits' : end_logits , } return inputs , outputs
Builds the model based on BERT.
Builds the model based on BERT .
"""Builds the model based on BERT."""
self
mode
bert_config
use_one_hot_embeddings