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: Segment a ranked document into paragraphs.
  
      sent_dist:
  a list of ranked Sentence data objects
  
      returns:
  a list of Paragraph data objects
          
code: def segment_paragraphs(
      self,
      sent_dist: typing.List[Sentence],
  ) -> typing.List[Paragraph]:
      """
      Segment a ranked document into paragraphs.
  
          sent_dist:
      a list of ranked Sentence data objects
  
          returns:
      a list of Paragraph data objects
      """
      para_elem: typing.List[int] = []
      para_bounds: typing.List[typing.List[int]] = []
  
      # first, determine the paragraph boundaries
      for sent_id, s in enumerate(self.doc.sents):
          toke_0 = str(s.__getitem__(0))
          ret_count = sum(map(lambda c: 1 if c == "\n" else 0, toke_0))
  
          # test for a paragraph boundary
          if ret_count > 1:
              if len(para_elem) > 0:
                  para_bounds.append(para_elem)
  
              para_elem = []
  
          # include this sentence
          para_elem.append(sent_id)
  
      # then finalize
      if len(para_elem) > 0:
          para_bounds.append(para_elem)
  
      # second, aggregate the distance measures and construct the
      # Paragraph data objects
      para_list: typing.List[Paragraph] = []
  
      for para_id, para_elem in enumerate(para_bounds):
          sum_dist = [
              sent_dist[sent_id].distance for sent_id in para_elem
          ]
  
          para_list.append(
              Paragraph(
                  para_id=para_id,
                  start=para_elem[0],
                  end=para_elem[-1],
                  distance=sum(sum_dist) / float(len(sum_dist)),
              )
          )
  
      return para_list
  
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 15 for calling the BaseTextRank obj's underlying member method code with example usage: obj.segment_paragraphs(sent_dist) and returns: para_list