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","."]
docstr: Get TF-IDF scores of spans
  return a list of spans sorted by desc order of importance
  span score = TF (global) * (1 + log_n(DF/N))
docstr_tok: ["Get","TF-IDF","scores","of","spans","return","a","list","of","spans","sorted","by","desc","order","of","importance","span","score","=","TF","(","global",")","*","(","1","+","log_n","(","DF\/N",")",")"]
code: def get_tfidf_scores(self, group_similar_spans=True):
      """
      Get TF-IDF scores of spans
      return a list of spans sorted by desc order of importance
      span score = TF (global) * (1 + log_n(DF/N))
      """
      phrases_and_scores = {}
      num_of_docs = len(self.documents)
      for _, noun_phrases in zip(self.documents, self.doc_text_spans):
          for p in noun_phrases:
              if p not in phrases_and_scores:
                  tf = self.index.tf(p)
                  df = self.index.df(p)
                  phrases_and_scores[p] = (tf + 1) * math.log(
                      1 + num_of_docs / df
                  )
      if len(phrases_and_scores) > 0:
          return self._maybe_group_and_sort(
              group_similar_spans, phrases_and_scores
          )
      return []
  
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 5 for calling the TextSpanScoring obj's underlying member method code with example usage: obj.get_tfidf_scores(group_similar_spans) and returns: list, self