docstr: Parameters
  ----------
  term_doc_matrix : TermDocMatrix
          Term document matrix object to compact
  non_text : bool
          Use non-text features instead of terms
  
  Returns
  -------
  New term doc matrix
docstr_tok: ["Parameters","--","--","--","--","--","term_doc_matrix",":","TermDocMatrix","Term","document","matrix","object","to","compact","non_text",":","bool","Use","non-text","features","instead","of","terms","Returns","--","--","--","-","New","term","doc","matrix"]
code: def compact(self, term_doc_matrix, non_text=False):
      """
      Parameters
      ----------
      term_doc_matrix : TermDocMatrix
              Term document matrix object to compact
      non_text : bool
              Use non-text features instead of terms
  
      Returns
      -------
      New term doc matrix
      """
      return term_doc_matrix.remove_terms_by_indices(
          self._indices_to_compact(term_doc_matrix, non_text), non_text
      )
  
file_path: scattertext/scattertext/termcompaction/CompactTerms.py
imports: import numpy
  from scattertext.CSRMatrixTools import CSRMatrixFactory
  from scattertext.indexstore import IndexStore
  from scattertext.termranking import AbsoluteFrequencyRanker
label_desc: Use image node_id 2 for calling the CompactTerms obj's underlying member method code with example usage: obj.compact(term_doc_matrix, non_text) and returns: term_doc_matrix