docstr: Constructs the term doc matrix.
  
  Returns
  -------
  TermDocMatrix
docstr_tok: ["Constructs","the","term","doc","matrix",".","Returns","--","--","--","-","TermDocMatrix"]
code: def build(self):
      """Constructs the term doc matrix.
  
      Returns
      -------
      TermDocMatrix
      """
  
      (
          X_factory,
          mX_factory,
          category_idx_store,
          term_idx_store,
          metadata_idx_store,
          y,
      ) = self._init_term_doc_matrix_variables()
      parse_pipeline = ParsePipelineFactory(
          self.get_nlp(),
          X_factory,
          mX_factory,
          category_idx_store,
          term_idx_store,
          metadata_idx_store,
          y,
          self,
      )
      df = self._clean_and_filter_nulls_and_empties_from_dataframe()
      tdm = self._apply_pipeline_and_get_build_instance(
          X_factory,
          mX_factory,
          category_idx_store,
          df,
          parse_pipeline,
          term_idx_store,
          metadata_idx_store,
          y,
      )
      return tdm
  
imports: import numpy
  import pandas
  from scattertext.AsianNLP import chinese_nlp
  from scattertext.CSRMatrixTools import CSRMatrixFactory
  from scattertext.TermDocMatrix import TermDocMatrix
  from scattertext.TermDocMatrixFactory import TermDocMatrixFactory
  from scattertext.TermDocMatrixWithoutCategories import TermDocMatrixWithoutCategories
  from scattertext.indexstore.IndexStore import IndexStore
label_desc: Use image node_id 2 for calling the TermDocMatrixFromPandas obj's underlying member method code with example usage: obj.build() and returns: tdm