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: Plot a document's keyphrases rank profile using
  [`altair.Chart`](https://altair-viz.github.io/user_guide/generated/toplevel/altair.Chart.html)
  
  Throws an `ImportError` if the `altair` and `pandas` libraries are not installed.
  
      returns:
  the `altair` chart being rendered
          
code: def plot_keyphrases(self) -> typing.Any:
      """
      Plot a document's keyphrases rank profile using
      [`altair.Chart`](https://altair-viz.github.io/user_guide/generated/toplevel/altair.Chart.html)
  
      Throws an `ImportError` if the `altair` and `pandas` libraries are not installed.
  
          returns:
      the `altair` chart being rendered
      """
      if not _has_altair_and_pandas:
          raise ImportError(
              "altair and pandas are required to use this method. Install them with `pip install 'pytextrank[viz]'`"
          )
  
      source = (
          pd.DataFrame([p.__dict__ for p in self.doc._.phrases])
          .drop("chunks", axis=1)
          .reset_index()
      )
  
      c = (
          alt.Chart(source)
          .mark_bar()
          .encode(
              x="index",
              y="rank",
              color="count",
              tooltip=["text", "rank", "count"],
          )
          .properties(title="Keyphrase profile of the document")
      )
  
      return c
  
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 18 for calling the BaseTextRank obj's underlying member method code with example usage: obj.plot_keyphrases() and returns: c