def METHOD_NAME(config, docid_idx_dict, vocab_idx_dict):
    num_docs, num_vocabs = len(docid_idx_dict) // 2, len(vocab_idx_dict) // 2
    logging.info(f'Building tf.idf sparse matrix with {num_docs} docs and {num_vocabs} features...')
    tfidf_dict = {}
    count = 0
    source_name = config['target']['name']
    tfidf_raw = os.path.join(working_directory, f'docids.{source_name}.docvector.TF_IDF.tar.gz')
    reader = utils.TfidfTgzReader(tfidf_raw)
    while reader.hasnextdoc():
        docid = reader.getnextdoc().strip()
        count += 1
        if count % 100000 == 0:
            logging.info(f'{count} documents processed...')
        if docid not in docid_idx_dict:
            reader.skipdoc()
            continue
        doc_idx = docid_idx_dict[docid]
        while reader.hasnexttfidf():
            word, tfidf = reader.getnexttfidf()
            if word in vocab_idx_dict:
                vocab_idx = vocab_idx_dict[word]
                tfidf_dict[(doc_idx, vocab_idx)] = float(tfidf)
    logging.info(f'Finished building tf.idf dict, {count} documents in total.')
    indices = tuple(zip(*tfidf_dict.keys()))
    values = list(tfidf_dict.values())
    tfidf_sp = scipy.sparse.csr_matrix((values, indices), shape=(num_docs, num_vocabs), dtype=np.float32)
    logging.info(f'Finished building tf.idf sparse matrix.')
    return sklearn.preprocessing.normalize(tfidf_sp, norm='l2')