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: Aggregate the rank metrics of the individual nodes (tokens) within
  each phrase.
  
      spans:
  spans of noun chunks
  
      ranks:
  rank metrics corresponding to each node
  
      returns:
  phrases extracted from the lemma graph, each with an aggregate rank metric
          
code: def _collect_phrases(
      self,
      spans: typing.Iterable[Span],
      ranks: typing.Dict[Lemma, float],
  ) -> typing.Dict[Span, float]:
      """
      Aggregate the rank metrics of the individual nodes (tokens) within
      each phrase.
  
          spans:
      spans of noun chunks
  
          ranks:
      rank metrics corresponding to each node
  
          returns:
      phrases extracted from the lemma graph, each with an aggregate rank metric
      """
      phrases: typing.Dict[Span, float] = {
          span: sum(
              ranks[Lemma(token.lemma_, token.pos_)]
              for token in span
              if self._keep_token(token)
          )
          for span in spans
      }
  
      return {
          span: self._calc_discounted_normalised_rank(span, sum_rank)
          for span, sum_rank in phrases.items()
      }
  
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 10 for calling the BaseTextRank obj's underlying member method code with example usage: obj._collect_phrases(spans, ranks) and returns: unknown