original_docstring:  Generate feature matrix based on one-hot vectorization for input texts by specified mini-batch.
  
          This generator is used in the prediction process by means of the trained neural model. Each text is a unicode
          string in which all tokens are separated by spaces. It generates a 3-D array (numpy.ndarray object), using
          one-hot enconding (first dimension is index of text in the mini-batch, second dimension is a timestep, or token
          position in this text, and third dimension is index of this token in the input vocabulary).
  
          :param input_texts: sequence (list, tuple or numpy.ndarray) of input texts.
          :param batch_start: a starting input text in the mini-batch.
          :param batch_end: an ending input text in the mini-batch.
          :param max_encoder_seq_length: maximal length of any input text.
          :param input_token_index: the special index for one-hot encoding any input text as numerical feature matrix.
          :param lowercase: the need to bring all tokens of all texts to the lowercase.
  
          :return the 3-D array representation of input mini-batch data.
  
          
docstring: Generate feature matrix based on one-hot vectorization for input texts by specified mini-batch.
  This generator is used in the prediction process by means of the trained neural model. Each text is a unicode
  string in which all tokens are separated by spaces. It generates a 3-D array (numpy.ndarray object), using
  one-hot enconding (first dimension is index of text in the mini-batch, second dimension is a timestep, or token
  position in this text, and third dimension is index of this token in the input vocabulary).
  
  :param input_texts: sequence (list, tuple or numpy.ndarray) of input texts.
  :param batch_start: a starting input text in the mini-batch.
  :param batch_end: an ending input text in the mini-batch.
  :param max_encoder_seq_length: maximal length of any input text.
  :param input_token_index: the special index for one-hot encoding any input text as numerical feature matrix.
  :param lowercase: the need to bring all tokens of all texts to the lowercase.
  
  :return the 3-D array representation of input mini-batch data.
docstring_tokens: Generate feature matrix based on one - hot vectorization for input texts by specified mini - batch . This generator is used in the prediction process by means of the trained neural model . Each text is a unicode string in which all tokens are separated by spaces . It generates a 3 - D array ( numpy . ndarray object ) using one - hot enconding ( first dimension is index of text in the mini - batch second dimension is a timestep or token position in this text and third dimension is index of this token in the input vocabulary ) . : param input_texts : sequence ( list tuple or numpy . ndarray ) of input texts . : param batch_start : a starting input text in the mini - batch . : param batch_end : an ending input text in the mini - batch . : param max_encoder_seq_length : maximal length of any input text . : param input_token_index : the special index for one - hot encoding any input text as numerical feature matrix . : param lowercase : the need to bring all tokens of all texts to the lowercase . : return the 3 - D array representation of input mini - batch data .
code: def generate_data_for_prediction(input_texts, batch_start, batch_end, max_encoder_seq_length, input_token_index, lowercase):
          """ Generate feature matrix based on one-hot vectorization for input texts by specified mini-batch.
  
          This generator is used in the prediction process by means of the trained neural model. Each text is a unicode
          string in which all tokens are separated by spaces. It generates a 3-D array (numpy.ndarray object), using
          one-hot enconding (first dimension is index of text in the mini-batch, second dimension is a timestep, or token
          position in this text, and third dimension is index of this token in the input vocabulary).
  
          :param input_texts: sequence (list, tuple or numpy.ndarray) of input texts.
          :param batch_start: a starting input text in the mini-batch.
          :param batch_end: an ending input text in the mini-batch.
          :param max_encoder_seq_length: maximal length of any input text.
          :param input_token_index: the special index for one-hot encoding any input text as numerical feature matrix.
          :param lowercase: the need to bring all tokens of all texts to the lowercase.
  
          :return the 3-D array representation of input mini-batch data.
  
          """
          n = len(input_texts)
          if (batch_start < 0) or (batch_start >= n):
              err_msg = f'A mini-batch start = {batch_start} is wrong for ' \
                        f'the input dataset included {n} samples.'
              raise ValueError(err_msg)
          if (batch_end <= batch_start) or (batch_end > n):
              err_msg = f'A mini-batch end = {batch_end} is wrong for ' \
                        f'the input dataset included {n} samples.'
              raise ValueError(err_msg)
          batch_size = batch_end - batch_start
          encoder_input_data = np.zeros(
              (batch_size, max_encoder_seq_length, len(input_token_index)),
              dtype=np.float32)
          for i, input_text in enumerate(input_texts[batch_start:batch_end]):
              t = 0
              for char in Seq2SeqLSTM.tokenize_text(input_text, lowercase):
                  if t >= max_encoder_seq_length:
                      break
                  if char in input_token_index:
                      encoder_input_data[i, t, input_token_index[char]] = 1.0
                      t += 1
          return encoder_input_data
code_tokens: def generate_data_for_prediction ( input_texts , batch_start , batch_end , max_encoder_seq_length , input_token_index , lowercase ) : n = len ( input_texts ) if ( batch_start < 0 ) or ( batch_start >= n ) : err_msg = f'A mini-batch start = {batch_start} is wrong for ' f'the input dataset included {n} samples.' raise ValueError ( err_msg ) if ( batch_end <= batch_start ) or ( batch_end > n ) : err_msg = f'A mini-batch end = {batch_end} is wrong for ' f'the input dataset included {n} samples.' raise ValueError ( err_msg ) batch_size = batch_end - batch_start encoder_input_data = np . zeros ( ( batch_size , max_encoder_seq_length , len ( input_token_index ) ) , dtype = np . float32 ) for i , input_text in enumerate ( input_texts [ batch_start : batch_end ] ) : t = 0 for char in Seq2SeqLSTM . tokenize_text ( input_text , lowercase ) : if t >= max_encoder_seq_length : break if char in input_token_index : encoder_input_data [ i , t , input_token_index [ char ] ] = 1.0 t += 1 return encoder_input_data
short_docstring: Generate feature matrix based on one-hot vectorization for input texts by specified mini-batch.
short_docstring_tokens: Generate feature matrix based on one - hot vectorization for input texts by specified mini - batch .
comment: """ Generate feature matrix based on one-hot vectorization for input texts by specified mini-batch.
  
          This generator is used in the prediction process by means of the trained neural model. Each text is a unicode
          string in which all tokens are separated by spaces. It generates a 3-D array (numpy.ndarray object), using
          one-hot enconding (first dimension is index of text in the mini-batch, second dimension is a timestep, or token
          position in this text, and third dimension is index of this token in the input vocabulary).
  
          :param input_texts: sequence (list, tuple or numpy.ndarray) of input texts.
          :param batch_start: a starting input text in the mini-batch.
          :param batch_end: an ending input text in the mini-batch.
          :param max_encoder_seq_length: maximal length of any input text.
          :param input_token_index: the special index for one-hot encoding any input text as numerical feature matrix.
          :param lowercase: the need to bring all tokens of all texts to the lowercase.
  
          :return the 3-D array representation of input mini-batch data.
  
          """