def convert_word_index_to_sentence(word_idx, vocab):
    """Convert word indices to sentence."""
    s = ""
    for ind in range(len(word_idx)):
        w_idx = word_idx[ind]
        if w_idx> 0:
            s += vocab[w_idx-1]
            if ind < len(word_idx)-1:
                s+= " "
    return s