import tensorflow as tf

        end_label = tf.one_hot(self.end_label, tf.shape(self.logits2)[1], axis=1)

        if self.config.loss_type == 'cross_entropy':
            start_loss = tf.nn.softmax_cross_entropy_with_logits(
                logits=self.logits1, labels=start_label)
            end_loss = tf.nn.softmax_cross_entropy_with_logits(
                logits=self.logits2, labels=end_label)
            self.loss = tf.reduce_mean(start_loss + end_loss)
        else:
            start_loss = focal_loss(tf.nn.softmax(self.logits1, -1), start_label)
