def METHOD_NAME(tfidf_raw, docid_idx_dict, vocab_idx_dict):
  """
  """
  num_docs, num_vocabs = len(docid_idx_dict) // 2, len(vocab_idx_dict) // 2
  logging.info(f'start building tfidf sparse matrix with {num_docs} docs and {num_vocabs} vocabs...')
  tfidf_dict = {}
  count = 0
  reader = TfidfTgzReader(tfidf_raw)
  while reader.hasnextdoc():
    docid = reader.getnextdoc().strip()
    count += 1
    if count % 100000 == 0:
      logging.info(f'{count} files have been 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'finish building tfidf dict, {count} files in total.')
  indices = tuple(zip(*tfidf_dict.keys()))
  values = list(tfidf_dict.values())
  tfidf_sp = csr_matrix((values, indices), shape=(num_docs, num_vocabs), dtype=np.float32)
  logging.info(f'finish building tfidf sparse matrix.')
  return sklearn.preprocessing.normalize(tfidf_sp, norm='l2')