def convert_to_bert_vocab(vocab, items):
    """
    Converts a sequence of [tokens|ids] using the vocab.
    Tokens not in dictionary are skipped.
    :param vocab: dictionary
    :param items: list of tokens (strings)
    :return:
    """
    output = []
    for item in items:
        try:
            output.append(vocab[item])
        except KeyError:
            continue
    return output