def METHOD_NAME(data, transforms):
    def apply_transforms(data):
        for _, line in data:
            yield transforms(line)
    vocab = build_vocab_from_iterator(apply_transforms(data), specials=["<unk>", "<pad>"])
    vocab.set_default_index(vocab["<unk>"])
    return vocab