class_docstr: Encode a text sequence using a convolution model.
class_docstr_tok: ["Encode","a","text","sequence","using","a","convolution","model","."]
code: def __init__(
      self,
      vocab_size,
      word_emb_dim,
      output_emb_dim,
      max_seq_len,
      is_train,
      train_dropout=1.0,
      filter_widths=(3, 5, 7),
      num_filters=64,
      scope="TextCNN",
      num_ps_tasks=None,
      nonlinearity="tanh",
  ):
      super(ConvTextEncoder, self).__init__()
      self.vocab_size = vocab_size
      self.word_emb_dim = word_emb_dim
      self.output_emb_dim = output_emb_dim
      self.is_train = is_train
      self.dropout = train_dropout
      self.max_seq_len = max_seq_len
      with tf.variable_scope(scope):
          self.word_embedding_encoder = EmbeddingLookup(
              word_emb_dim,
              is_train,
              train_dropout=train_dropout,
              input_dim=vocab_size,
              num_ps_tasks=num_ps_tasks,
          )
          self.cnn_encoder = ConvSeqEncoder(
              output_emb_dim,
              word_emb_dim,
              max_seq_len,
              is_train,
              train_dropout=train_dropout,
              filter_widths=filter_widths,
              num_filters=num_filters,
              nonlinearity=nonlinearity,
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  import utils
label_desc: Use image node_id 1 to create a new ConvTextEncoder object from inherited base classes: Encoder with example: obj = ConvTextEncoder(vocab_size, word_emb_dim, output_emb_dim, max_seq_len, is_train, train_dropout, filter_widths, num_filters, scope, num_ps_tasks, nonlinearity)