def get_ids_and_masks(tokenizer, text):
    """
    This function takes a BertWordPieceTokenizer "tokenizer" and string "text"
    as input and returns the input_ids and attention_masks computed for "text".
    """
    input_ids = []
    attention_masks = []

    encoding = tokenizer.encode(text)
    input_ids.append(encoding.ids)
    attention_masks.append(encoding.attention_mask)

    return input_ids, attention_masks