class_docstr: Defines end to end MatchLSTM and Answer_Pointer network for Reading Comprehension
class_docstr_tok: ["Defines","end","to","end","MatchLSTM","and","Answer_Pointer","network","for","Reading","Comprehension"]
docstr: Args:
      params_dict: Dictionary containing the following keys-
                   'max_question' : max length of all questions in the dataset
                   'max_para' :  max length of all paragraphs in the dataset
                   'hidden_size': number of hidden units in the network
                   'batch_size' : batch size defined by user
  
      embeddings: Glove pretrained embedding matrix
docstr_tok: ["Args",":","params_dict",":","Dictionary","containing","the","following","keys-","'max_question","'",":","max","length","of","all","questions","in","the","dataset","'max_para","'",":","max","length","of","all","paragraphs","in","the","dataset","'hidden_size","'",":","number","of","hidden","units","in","the","network","'batch_size","'",":","batch","size","defined","by","user","embeddings",":","Glove","pretrained","embedding","matrix"]
code: def __init__(self, params_dict, embeddings):
      """
      Args:
          params_dict: Dictionary containing the following keys-
                       'max_question' : max length of all questions in the dataset
                       'max_para' :  max length of all paragraphs in the dataset
                       'hidden_size': number of hidden units in the network
                       'batch_size' : batch size defined by user
  
          embeddings: Glove pretrained embedding matrix
      """
  
      # Assign Variables:
      self.max_question = params_dict["max_question"]
      self.max_para = params_dict["max_para"]
      self.hidden_size = params_dict["hidden_size"]
      self.batch_size = params_dict["batch_size"]
      self.embeddings = embeddings
      self.inference_only = params_dict["inference_only"]
      self.G_i = None
      self.attn = None
      self.stacked_lists_forward = None
      self.stacked_lists_reverse = None
      self.logits_withsf = None
  
      # init tokenizer
      self.tokenizer = SpacyInstance(
          disable=["tagger", "ner", "parser", "vectors", "textcat"]
      )
  
      # Create Placeholders
      # Question ids
      self.question_ids = tf.placeholder(
          tf.int32, shape=[None, self.max_question], name="question_ids"
      )
      # Paragraph ids
      self.para_ids = tf.placeholder(
          tf.int32, shape=[None, self.max_para], name="para_ids"
      )
      # Length of question
      self.question_length = tf.placeholder(
          tf.int32, shape=[None], name="question_len"
      )
      # Length of paragraph
      self.para_length = tf.placeholder(
          tf.int32, shape=[None], name="para_len"
      )
      # Mask for paragraph
      self.para_mask = tf.placeholder(
          tf.float32, shape=[None, self.max_para], name="para_mask"
      )
      # Mask for question
      self.ques_mask = tf.placeholder(
          tf.float32, shape=[None, self.max_question], name="ques_mask"
      )
      # Answer spans
      if self.inference_only is False:
          self.labels = tf.placeholder(
              tf.int32, shape=[None, 2], name="labels"
          )
      # Dropout value
      self.dropout = tf.placeholder(
          tf.float32, shape=[], name="dropout"
      )
      self.global_step = tf.Variable(0, name="global")
  
      # Get variables
      self.create_variables()
  
      # Define model
      self.create_model()
  
file_path: nlp-architect/examples/reading_comprehension/match_lstm_mrc/matchlstm_ansptr.py
imports: from __future__ import division
  from __future__ import print_function
  import re
  from collections import Counter
  import numpy
  import tensorflow
  from nlp_architect.utils.text import SpacyInstance
label_desc: Use image node_id 1 to create a new MatchLSTMAnswerPointer object from inherited base classes: object with example: obj = MatchLSTMAnswerPointer(params_dict, embeddings)