def idx2sents(idx_seqs, vocab):
    """convert sequences of word indices to strings"""
    results = []
    for seq in idx_seqs:
        results.append(' '.join(vocab.idx2word[i] for i in seq))
    return results