class_docstr: Text spans scoring class.
  Contains misc scoring algorithms for scoring text fragments extracted
  from a corpus.
  
  Arguments:
      documents(list): List of spaCy documents.
      spans(list[list]): List of spaCy spans representing noun phrases of documents
          document.
class_docstr_tok: ["Text","spans","scoring","class",".","Contains","misc","scoring","algorithms","for","scoring","text","fragments","extracted","from","a","corpus",".","Arguments",":","documents","(","list",")",":","List","of","spaCy","documents",".","spans","(","list","[","list","]",")",":","List","of","spaCy","spans","representing","noun","phrases","of","documents","document","."]
code: def group_spans(self, phrases):
      pid_phrase_scores = [
          {"k": self.index.get_pid(p), "v": (p, s)}
          for p, s in phrases.items()
      ]
      phrase_groups = []
      for _, group in itertools.groupby(
          sorted(pid_phrase_scores, key=lambda x: x["k"]),
          lambda x: x["k"],
      ):
          _group = list(group)
          phrases = {g["v"][0].text for g in _group}
          score = _group[0]["v"][1]
          phrase_groups.append((sorted(phrases), score))
      return phrase_groups
  
imports: import itertools
  import math
  import numpy
  import logging
  from spacy.tokens.doc import Doc
  from spacy.tokens.span import Span
  from spacy.tokens.token import Token
label_desc: Use image node_id 7 for calling the TextSpanScoring obj's underlying member method code with example usage: obj.group_spans(phrases) and returns: phrase_groups