docstr: Generate a TermDocMatrix from data in parameters.
  
  Returns
  ----------
  term_doc_matrix : TermDocMatrix
     The object that this factory class builds.
docstr_tok: ["Generate","a","TermDocMatrix","from","data","in","parameters",".","Returns","--","--","--","--","--","term_doc_matrix",":","TermDocMatrix","The","object","that","this","factory","class","builds","."]
code: def build(self):
      """Generate a TermDocMatrix from data in parameters.
  
      Returns
      ----------
      term_doc_matrix : TermDocMatrix
         The object that this factory class builds.
      """
      if self._category_text_iter is None:
          raise CategoryTextIterNotSetError()
      nlp = self.get_nlp()
  
      category_document_iter = (
          (str(category), self._clean_function(raw_text))
          for category, raw_text in self._category_text_iter
      )
      term_doc_matrix = self._build_from_category_spacy_doc_iter(
          (
              (category, nlp(text))
              for (category, text) in category_document_iter
              if text.strip() != ""
          )
      )
      return term_doc_matrix
  
imports: import string
  from collections import Counter
  import numpy
  import pandas
  from scattertext.CSRMatrixTools import CSRMatrixFactory
  from scattertext.TermDocMatrix import TermDocMatrix
  from scattertext.features.FeatsFromSpacyDoc import FeatsFromSpacyDoc
  from scattertext.indexstore.IndexStore import IndexStore
label_desc: Use image node_id 4 for calling the TermDocMatrixFactory obj's underlying member method code with example usage: obj.build() and returns: term_doc_matrix