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: collect instances of phrases from the lemma graph
  based on the given chunk
docstr_tok: ["collect","instances","of","phrases","from","the","lemma","graph","based","on","the","given","chunk"]
code: def collect_phrases(self, chunk):
      """
      collect instances of phrases from the lemma graph
      based on the given chunk
      """
      phrase = CollectedPhrase(chunk, self.scrubber)
      compound_key = set([])
  
      for i in phrase.range():
          token = self.doc[i]
          key = (token.lemma_, token.pos_)
  
          if key in self.seen_lemma:
              node_id = list(self.seen_lemma.keys()).index(key)
              rank = self.ranks[node_id]
              phrase.sq_sum_rank += rank
              compound_key.add(key)
  
              if self.logger:
                  self.logger.debug(
                      " {} {} {} {}".format(
                          token.lemma_, token.pos_, node_id, rank
                      )
                  )
          else:
              phrase.non_lemma += 1
  
      phrase.set_key(compound_key)
      phrase.calc_rank()
  
      self.phrases[phrase.key].append(phrase)
  
      if self.logger:
          self.logger.debug(phrase)
  
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 7 for calling the TextRank obj's underlying member method code with example usage: obj.collect_phrases(chunk) without return types