def tokenize_input(input_sent, vocab):
 input_tok = []
 for sent in input_sent:
  text_int = [((-1) if (t not in vocab) else vocab[t]) for t in tokenize(sent)]
  input_tok.append(np.array(text_int))
 return np.array(input_tok)

def tokenize_input ( input_sent , vocab ) : input_tok = [ ] for sent in input_sent : text_int = [ ( ( - 1 ) if ( t not in vocab ) else vocab [ t ] ) for t in tokenize ( sent ) ] input_tok . append ( np . array ( text_int ) ) return np . array ( input_tok )
return a numpy array where each row is the word-indexes for each sentence .