def METHOD_NAME(self, questions, attribute):
    # Vocab should only be built from "train" as val and test are not observed in training
    if self._dataset_type != _CONSTANTS["train_dataset_key"]:
        return
    vocab_file = self._get_vocab_path(attribute)
    # Already exists, no need to recreate
    if os.path.exists(vocab_file):
        return
    # Create necessary dirs if not present
    os.makedirs(os.path.dirname(vocab_file), exist_ok=True)
    sentences = [question[attribute] for question in questions]
    build_attributes = self.config.build_attributes
    # Regex is default one in tokenize i.e. space
    kwargs = {
        "min_count": build_attributes.get("min_count", 1),
        "keep": build_attributes.get("keep", [";", ","]),
        "remove": build_attributes.get("remove", ["?", "."]),
    }
    if attribute == _CONSTANTS["answer_key"]:
        kwargs["only_unk_extra"] = False
    vocab = VocabFromText(sentences, **kwargs)
    with open(vocab_file, "w") as f:
        f.write("\n".join(vocab.word_list))