def precompute_idfs(wglobal, dfs, total_docs):
    # not strictly necessary and could be computed on the fly in TfidfModel__getitem__.
    # this method is here just to speed things up a little.
    return dict((termid, wglobal(df, total_docs))
                for termid, df in iteritems(dfs))
Precompute the inverse document frequency mapping for all terms.
dataset/ETHPy150Open largelymfs/topical_word_embeddings/TWE-1/gensim/models/tfidfmodel.py/precompute_idfs