class_docstr: Python impl of TextRank by Milhacea, et al., as a spaCy extension,
  used to extract the top-ranked phrases from a text document
class_docstr_tok: ["Python","impl","of","TextRank","by","Milhacea",",","et","al.",",","as","a","spaCy","extension",",","used","to","extract","the","top-ranked","phrases","from","a","text","document"]
docstr: define a custom pipeline component for spaCy and extend the
  Doc class to add TextRank, when doc gets processed
docstr_tok: ["define","a","custom","pipeline","component","for","spaCy","and","extend","the","Doc","class","to","add","TextRank",",","when","doc","gets","processed"]
code: def __call__(self, doc: Doc) -> Doc:
      """
      define a custom pipeline component for spaCy and extend the
      Doc class to add TextRank, when doc gets processed
      """
      self.doc = doc
  
      Doc.set_extension("phrases", force=True, default=[])
      Doc.set_extension("textrank", force=True, default=self)
      doc._.phrases = self.calc_textrank()
  
      return doc
  
imports: from .base import BaseTextRank
  from .positionrank import PositionRank
  from collections import defaultdict, OrderedDict
  from math import sqrt
  from spacy.tokens import Doc
  import graphviz
  import json
  import logging
  import networkx
  import os
  import os.path
  import re
  import spacy
  import string
  import sys
  import time
  import unicodedata
label_desc: Use image node_id 2 for calling the TextRank obj's underlying member method code with example usage: obj.__call__(doc) and returns: doc