code: def _get_term_frequencies(self, non_text, term_doc_matrix):
      ranker = self.term_ranker(term_doc_matrix)
      if non_text:
          ranker = ranker.use_non_text_features()
      freqs = ranker.get_ranks().sum(axis=1)
      return freqs
  
file_path: scattertext/scattertext/termcompaction/npmi_compactor.py
imports: import numpy
  import pandas
  from tqdm.auto import tqdm
  from scattertext.termranking.TermRanker import TermRanker
  from scattertext.termranking.AbsoluteFrequencyRanker import AbsoluteFrequencyRanker
label_desc: Use image node_id 4 for calling the NPMICompactor obj's underlying member method code with example usage: obj._get_term_frequencies(non_text, term_doc_matrix) and returns: freqs