code: def run(args):
      # ParlAI version of run method, modified slightly
      logging.info("Counting words...")
      count_matrix = get_count_matrix(args, {"db_path": args.db_path})
  
      logging.info("Making tfidf vectors...")
      tfidf = get_tfidf_matrix(count_matrix)
  
      logging.info("Getting word-doc frequencies...")
      freqs = get_doc_freqs(count_matrix)
  
      filename = args.out_dir
  
      logging.info("Saving to %s" % filename)
      metadata = {
          "doc_freqs": freqs,
          "tokenizer": args.tokenizer,
          "hash_size": args.hash_size,
          "ngram": args.ngram,
      }
  
      utils.save_sparse_csr(filename, tfidf, metadata)
  
imports: import numpy
  import scipy.sparse
  import math
  from multiprocessing import Pool
  from multiprocessing.util import Finalize
  from functools import partial
  from collections import Counter
  from .None import utils
  from .doc_db import DocDB
  from .None import tokenizers
  import parlai.utils.logging
label_desc: Use image node_id 10 for calling a global function with example usage: run(args) without return types