docstr: Returns a TermDocMatrix which is identical to self except the metadata values are now identical to the
   categories present and term-doc-matrix is now the metadata matrix.
  
  :return: TermDocMatrix
docstr_tok: ["Returns","a","TermDocMatrix","which","is","identical","to","self","except","the","metadata","values","are","now","identical","to","the","categories","present","and","term-doc-matrix","is","now","the","metadata","matrix",".",":","return",":","TermDocMatrix"]
code: def use_categories_as_metadata_and_replace_terms(self):
      """
      Returns a TermDocMatrix which is identical to self except the metadata values are now identical to the
       categories present and term-doc-matrix is now the metadata matrix.
  
      :return: TermDocMatrix
      """
      new_tdm = self._make_new_term_doc_matrix(
          new_X=self._mX,
          new_mX=self._categories_to_metadata_factory(),
          new_y=self._y,
          new_term_idx_store=self._metadata_idx_store,
          new_category_idx_store=self._category_idx_store,
          new_metadata_idx_store=copy(self._category_idx_store),
          new_y_mask=self._y == self._y,
          new_term_offsets=self._metadata_offsets,
          new_metadata_offsets={k: [] for k in self.get_categories()},
      )
      return new_tdm
  
file_path: scattertext/scattertext/OffsetCorpus.py
imports: from copy import copy
  from scattertext.ParsedCorpus import ParsedCorpus
label_desc: Use image node_id 5 for calling the OffsetCorpus obj's underlying member method code with example usage: obj.use_categories_as_metadata_and_replace_terms() and returns: new_tdm