class_docstr: Implements the *TextRank* algorithm defined by
  [[mihalcea04textrank]](https://derwen.ai/docs/ptr/biblio/#mihalcea04textrank),
  deployed as a `spaCy` pipeline component.
  
  This class does not get called directly; instantiate its factory
  instead.
      
class_docstr_tok: ["Implements","the","*","TextRank","*","algorithm","defined","by","[","[","mihalcea04textrank","]","]","(","https",":","\/\/derwen.ai\/docs\/ptr\/biblio\/","#","mihalcea04textrank",")",",","deployed","as","a","`","spaCy","`","pipeline","component",".","This","class","does","not","get","called","directly",";","instantiate","its","factory","instead","."]
docstr: Constructor for a `TextRank` object.
  
      doc:
  a document container, providing the annotations produced by earlier stages of the `spaCy` pipeline
  
      edge_weight:
  default weight for an edge
  
      pos_kept:
  parts of speech tags to be kept; adjust this if strings representing the POS tags change
  
      token_lookback:
  the window for neighboring tokens – similar to a *skip gram*
  
      scrubber:
  optional "scrubber" function to clean up punctuation from a token
  
      stopwords:
  optional dictionary of `lemma: [pos]` items to define the *stop words*, where each item has a key as a lemmatized token and a value as a list of POS tags
          
code: def __init__(
      self,
      doc: Doc,
      edge_weight: float,
      pos_kept: typing.List[str],
      token_lookback: int,
      scrubber: typing.Callable,
      stopwords: typing.Dict[str, typing.List[str]],
  ) -> None:
      """
      Constructor for a `TextRank` object.
  
          doc:
      a document container, providing the annotations produced by earlier stages of the `spaCy` pipeline
  
          edge_weight:
      default weight for an edge
  
          pos_kept:
      parts of speech tags to be kept; adjust this if strings representing the POS tags change
  
          token_lookback:
      the window for neighboring tokens – similar to a *skip gram*
  
          scrubber:
      optional "scrubber" function to clean up punctuation from a token
  
          stopwords:
      optional dictionary of `lemma: [pos]` items to define the *stop words*, where each item has a key as a lemmatized token and a value as a list of POS tags
      """
      self.doc: Doc = doc
      self.edge_weight: float = edge_weight
      self.token_lookback: int = token_lookback
      self.pos_kept: typing.List[str] = pos_kept
      self.scrubber: typing.Callable = scrubber
      self.stopwords: typing.Dict[str, typing.List[str]] = stopwords
  
      # internal data for BiasedTextRank
      self.focus_tokens: typing.Set[str] = set()
      self.node_bias = 1.0
      self.default_bias = 1.0
  
      # effectively, performs the same work as the `reset()` method;
      # called explicitly here for the sake of type annotations
      self.elapsed_time: float = 0.0
      self.lemma_graph: nx.DiGraph = nx.DiGraph()
      self.phrases: typing.List[Phrase] = []
      self.ranks: typing.Dict[Lemma, float] = {}
      self.seen_lemma: typing.Dict[
          Lemma, typing.Set[int]
      ] = OrderedDict()
  
imports: from collections import Counter, defaultdict, OrderedDict
  from dataclasses import dataclass
  import json
  import math
  import pathlib
  import time
  import typing
  from icecream import ic
  from spacy.tokens import Doc, Span, Token
  import graphviz
  import networkx
  from .util import groupby_apply, default_scrubber
label_desc: Use image node_id 1 to create a new BaseTextRank object  with example: obj = BaseTextRank(doc, edge_weight, pos_kept, token_lookback, scrubber, stopwords)