def encode_line_wordwise(line, vocab):
    """Given a string and vocab, return the word encoded version"""
    splited = line.split()
    sequence_input = [vocab.get(word, vocab['UNK']) for word in splited]
    sequence_input = [vocab['GOO']] + sequence_input + [vocab['EOS']]
    sequence_length = len(sequence_input) - 1
    return sequence_input, sequence_length