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: Function to get answer indices given the predictions
  
  Args:
      preds_start: predicted start indices
      predictions: predicted end indices
  
  Returns:
      final start and end indices for the answer
docstr_tok: ["Function","to","get","answer","indices","given","the","predictions","Args",":","preds_start",":","predicted","start","indices","predictions",":","predicted","end","indices","Returns",":","final","start","and","end","indices","for","the","answer"]
code: def obtain_indices(preds_start, preds_end):
      """
      Function to get answer indices given the predictions
  
      Args:
          preds_start: predicted start indices
          predictions: predicted end indices
  
      Returns:
          final start and end indices for the answer
      """
      ans_start = []
      ans_end = []
      for i in range(preds_start.shape[0]):
          max_ans_id = -100000000
          st_idx = 0
          en_idx = 0
          ele1 = preds_start[i]
          ele2 = preds_end[i]
          len_para = len(ele1)
          for j in range(len_para):
              for k in range(15):
                  if j + k >= len_para:
                      break
                  ans_start_int = ele1[j]
                  ans_end_int = ele2[j + k]
                  if (ans_start_int + ans_end_int) > max_ans_id:
                      max_ans_id = ans_start_int + ans_end_int
                      st_idx = j
                      en_idx = j + k
  
          ans_start.append(st_idx)
          ans_end.append(en_idx)
  
      return (np.array(ans_start), np.array(ans_end))
  
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 6 for calling the MatchLSTMAnswerPointer obj's underlying member method code with example usage: obj.obtain_indices(preds_start, preds_end) and returns: np,  np