class_docstr: A factory class that provides the document with its instance of
  `TopicRank`
      
docstr: Set the extension attributes on a `spaCy` [`Doc`](https://spacy.io/api/doc)
  document to create a *pipeline component* for `TopicRank` as
  a stateful component, invoked when the document gets processed.
  
  See: <https://spacy.io/usage/processing-pipelines#pipelines>
  
      doc:
  a document container, providing the annotations produced by earlier stages of the `spaCy` pipeline
          
docstr_tok: ["Set","the","extension","attributes","on","a","`","spaCy","`","[","`","Doc","`","]","(","https",":","\/\/spacy.io\/api\/doc",")","document","to","create","a","*","pipeline","component","*","for","`","TopicRank","`","as","a","stateful","component",",","invoked","when","the","document","gets","processed",".","See",":","<","https",":","\/\/spacy.io\/usage\/processing-pipelines","#","pipelines",">","doc",":","a","document","container",",","providing","the","annotations","produced","by","earlier","stages","of","the","`","spaCy","`","pipeline"]
code: def __call__(
      self,
      doc: Doc,
  ) -> Doc:
      """
      Set the extension attributes on a `spaCy` [`Doc`](https://spacy.io/api/doc)
      document to create a *pipeline component* for `TopicRank` as
      a stateful component, invoked when the document gets processed.
  
      See: <https://spacy.io/usage/processing-pipelines#pipelines>
  
          doc:
      a document container, providing the annotations produced by earlier stages of the `spaCy` pipeline
      """
      Doc.set_extension("textrank", force=True, default=None)
      Doc.set_extension("phrases", force=True, default=[])
  
      doc._.textrank = TopicRank(
          doc,
          edge_weight=self.edge_weight,
          pos_kept=self.pos_kept,
          token_lookback=self.token_lookback,
          scrubber=self.scrubber,
          stopwords=self.stopwords,
          threshold=self.threshold,
          method=self.method,
      )
  
      doc._.phrases = doc._.textrank.calc_textrank()
      return doc
  
imports: from collections import defaultdict
  from functools import lru_cache
  import time
  import typing
  from icecream import ic
  from scipy.cluster.hierarchy import fcluster, linkage
  from scipy.spatial.distance import pdist
  from spacy.tokens import Doc, Span
  import networkx
  from .base import BaseTextRank, BaseTextRankFactory, Phrase, StopWordsLike
label_desc: Use image node_id 2 for calling the TopicRankFactory obj's underlying member method code with example usage: obj.__call__(doc) and returns: doc