code: def score_documents(
      self, texts: list, limit=-1, return_all=False, min_tf=5
  ):
      documents = []
      assert len(texts) > 0, "texts should contain at least 1 document"
      assert min_tf > 0, "min_tf should be at least 1"
      with tqdm(
          total=len(texts),
          desc="documents scoring progress",
          unit="docs",
      ) as pbar:
          for doc in self.nlp.pipe(texts, n_threads=-1):
              if len(doc) > 0:
                  documents.append(doc)
              pbar.update(1)
  
      corpus = []
      for doc in documents:
          spans = get_noun_phrases(doc)
          if len(spans) > 0:
              corpus.append((doc, spans))
  
      if len(corpus) < 1:
          return []
  
      documents, doc_phrases = list(zip(*corpus))
      scorer = TextSpanScoring(
          documents=documents, spans=doc_phrases, min_tf=min_tf
      )
      tfidf_scored_list = scorer.get_tfidf_scores()
      if len(tfidf_scored_list) < 1:
          return []
      cvalue_scored_list = scorer.get_cvalue_scores()
      freq_scored_list = scorer.get_freq_scores()
  
      if limit > 0:
          tf = {tuple(k[0]): k[1] for k in tfidf_scored_list}
          cv = {tuple(k[0]): k[1] for k in cvalue_scored_list}
          fr = {tuple(k[0]): k[1] for k in freq_scored_list}
          tfidf_scored_list_limit = []
          cvalue_scored_list_limit = []
          freq_scored_list_limit = []
          for phrase in list(zip(*tfidf_scored_list))[0][:limit]:
              tfidf_scored_list_limit.append(
                  (phrase, tf[tuple(phrase)])
              )
              cvalue_scored_list_limit.append(
                  (phrase, cv[tuple(phrase)])
              )
              freq_scored_list_limit.append((phrase, fr[tuple(phrase)]))
          tfidf_scored_list = tfidf_scored_list_limit
          cvalue_scored_list = cvalue_scored_list_limit
          freq_scored_list = freq_scored_list_limit
  
      tfidf_scored_list = scorer.normalize_l2(tfidf_scored_list)
      cvalue_scored_list = scorer.normalize_l2(cvalue_scored_list)
      freq_scored_list = scorer.normalize_minmax(
          freq_scored_list, invert=True
      )
      tfidf_scored_list = scorer.normalize_minmax(tfidf_scored_list)
      cvalue_scored_list = scorer.normalize_minmax(cvalue_scored_list)
      if return_all:
          tf = {tuple(k[0]): k[1] for k in tfidf_scored_list}
          cv = {tuple(k[0]): k[1] for k in cvalue_scored_list}
          fr = {tuple(k[0]): k[1] for k in freq_scored_list}
          final_list = []
          for phrases in tf.keys():
              final_list.append(
                  (
                      [p for p in phrases],
                      tf[phrases],
                      cv[phrases],
                      fr[phrases],
                  )
              )
          return final_list
      merged_list = scorer.interpolate_scores(
          [tfidf_scored_list, cvalue_scored_list], [0.5, 0.5]
      )
      merged_list = scorer.multiply_scores(
          [merged_list, freq_scored_list]
      )
      merged_list = scorer.normalize_minmax(merged_list)
      final_list = []
      for phrases, score in merged_list:
          if any([len(p) > 1 for p in phrases]):
              final_list.append(([p for p in phrases], score))
      return final_list
  
file_path: nlp-architect/solutions/trend_analysis/np_scorer.py
imports: import logging
  from os import path, makedirs
  from tqdm import tqdm
  from nlp_architect import LIBRARY_OUT
  from nlp_architect.pipelines.spacy_np_annotator import NPAnnotator, get_noun_phrases
  from nlp_architect.utils.io import download_unlicensed_file
  from nlp_architect.utils.text import SpacyInstance
  from .scoring_utils import TextSpanScoring
label_desc: Use image node_id 2 for calling the NPScorer obj's underlying member method code with example usage: obj.score_documents(texts, limit, return_all, min_tf) and returns: final_list, list, list, final_list