def METHOD_NAME(self):
    indptr = [0]
    indices = []
    data = []
    vocabulary = {}
    if self.text_for_bow is not None:
        docs = self.text_for_bow
    else:
        docs = self.text_for_bert
    for d in docs:
        for term in d.split():
            index = vocabulary.setdefault(term, len(vocabulary))
            indices.append(index)
            data.append(1)
        indptr.append(len(indices))
    self.vocab_dict = vocabulary
    self.vocab = list(vocabulary.keys())
    warnings.simplefilter('always', DeprecationWarning)
    if len(self.vocab) > 2000:
        warnings.warn("The vocab you are using has more than 2000 words, reconstructing high-dimensional vectors requires"
                      "significantly more training epochs and training samples. "
                      "Consider reducing the number of vocabulary items. "
                      "See https://github.com/MilaNLProc/contextualized-topic-models#preprocessing "
                      "and https://github.com/MilaNLProc/contextualized-topic-models#tldr", Warning)
    self.idx2token = {v: k for (k, v) in self.vocab_dict.items()}
    self.bow = scipy.sparse.csr_matrix((data, indices, indptr), dtype=int)