def vectorize(tokens, vocab):
    """
    Covert array of tokens, to array of ids
    Args:
        tokens (list): list of tokens
        vocab (Vocab):
    Returns:  list of ids
    """
    ids = []
    for token in tokens:
        if token in vocab.tok2id:
            ids.append(vocab.tok2id[token])
        else:
            ids.append(vocab.tok2id[vocab.UNK])
    return ids