def convert_to_idx(corpus, word2idx):
    return [[word2idx.get(word, '<UNK>') for word in sent] for sent in corpus]
def convert_to_idx(corpus, word2idx):
    return [[word2idx.get(word, '<UNK>') for word in sent] for sent in corpus]