import tensorflow as tf


  def to_json_string(self):
    """Serializes this instance to a JSON string."""
    return json.dumps(self.to_dict(), indent=2, sort_keys=True) + "\n"


def create_model(config, is_training, input_ids, input_mask, segment_ids,
                 labels, num_labels, use_one_hot_embeddings, task_name,):
  """Creates a classification model from_scratch."""
  _true_length = tf.cast(tf.reduce_sum(input_mask, axis=-1), dtype=tf.int32)

  with tf.variable_scope("baseline"):
    with tf.variable_scope("embeddings"):
      # Perform embedding lookup on the word ids.
      (word_embedding_output,
        output_embedding_table) = modeling.embedding_lookup(
          input_ids=input_ids,
          vocab_size=config.vocab_size,
          embedding_size=config.embedding_size,
          initializer_range=config.initializer_range,
          word_embedding_name="word_embeddings",
          use_one_hot_embeddings=use_one_hot_embeddings)
