def word_list_to_idx_list(word_list, w2v_vocab):
    """ Convert each word in word_list
    to its equivalent index in w2v_vocab (Word2Vec model vocab)
    """

    idx_list = []
    for word_seq in word_list:
        # we add 1 to distinguish class 0 from padded zeros
        # (because we will pad zeros during training!)
        # idx_seq = [ (index2word.index(word) + 1) for word in word_seq ]
        idx_seq = [ (w2v_vocab.get(word).index + 1) for word in word_seq ]
        idx_list.append(idx_seq)

    return idx_list