def convert_ids_to_toks(token_ids, tokenizer):
    """
    Convert tokens id to tokens word
    :input:
        token_ids:   tokens id
        tokenizer:   tokenizer from Huggingface
    """
    special_tokens = tokenizer.special_tokens_map_extended.values()
    results = []
    for tok_ids in token_ids:
        tok_words = tokenizer.convert_ids_to_tokens(tok_ids)
        result_toks = []
        for word in tok_words:
            if word == tokenizer.sep_token: #word == tokenizer.eos_token 
                break
            if word not in special_tokens:
                result_toks.append(word)
        results.append(' '.join(result_toks))
    return results