def idx_to_word(seq, ivocab, remove_eos_token=True):
    """
    Get the words for a sequence of word IDs
    :param seq:
    :param ivocab:
    :param unk_symbol:
    :param remove_eos_token:
    :return:
    """

    # remove EOS token
    if seq[-1] == 0 and remove_eos_token:
        seq = seq[:-1]

    unk_symbol = ivocab[1]
    translation = ' '.join([ivocab.get(idx, unk_symbol) for idx in seq])
    return translation