(input_sent, vocab)
return np.array(input_tok)
Return a numpy array where each row is the word-indexes for each sentence
Return a numpy array where each row is the word-indexes for each sentence
Return a numpy array where each row is the word - indexes for each sentence
def tokenize_input(input_sent, vocab):
    """
    Return a numpy array where each row is the word-indexes for each sentence
    """
    input_tok = []

    # map text to integers
    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 = [ ] # map text to integers 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 )