docstr: Parameters
  ----------
  category_doc_iter : iterator of (string category name, spacy.tokens.doc.Doc) pairs
  
  Returns
  ----------
  t : TermDocMatrix
docstr_tok: ["Parameters","--","--","--","--","--","category_doc_iter",":","iterator","of","(","string","category","name",",","spacy.tokens.doc.Doc",")","pairs","Returns","--","--","--","--","--","t",":","TermDocMatrix"]
code: def _build_from_category_spacy_doc_iter(self, category_doc_iter):
      """
      Parameters
      ----------
      category_doc_iter : iterator of (string category name, spacy.tokens.doc.Doc) pairs
  
      Returns
      ----------
      t : TermDocMatrix
      """
      term_idx_store = IndexStore()
      category_idx_store = IndexStore()
      metadata_idx_store = IndexStore()
      (
          X,
          mX,
          y,
      ) = self._get_features_and_labels_from_documents_and_indexes(
          category_doc_iter,
          category_idx_store,
          term_idx_store,
          metadata_idx_store,
      )
      return TermDocMatrix(
          X,
          mX,
          y,
          term_idx_store=term_idx_store,
          category_idx_store=category_idx_store,
          metadata_idx_store=metadata_idx_store,
      )
  
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 7 for calling the TermDocMatrixFactory obj's underlying member method code with example usage: obj._build_from_category_spacy_doc_iter(category_doc_iter) and returns: TermDocMatrix