code: def get_elimination_df(
      self, term_doc_matrix, non_text=False
  ) -> pd.DataFrame:
      freq_df = pd.DataFrame(
          {
              "Count": self.term_ranker(term_doc_matrix)
              .set_non_text(non_text)
              .get_ranks()
              .sum(axis=1),
          }
      )[lambda df: df.Count >= self.minimum_term_count]
      max_subgramsize = (
          max(len(tok.split()) for tok in freq_df.index) - 1
      )
      eliminations = []
      eliminators = []
      it = freq_df.iterrows()
      if self.verbose:
          it = tqdm(freq_df.iterrows(), total=len(freq_df))
      for row_i, row in it:
          toks = row.name.split()
          gram_len = len(toks)
          if gram_len > 1:
              subgrams = []
              for i in range(min(max_subgramsize, gram_len - 1), 0, -1):
                  for subtoks in sequence_window(toks, i):
                      subgrams.append(" ".join(subtoks))
              found_subgrams = freq_df.index.intersection(subgrams)
              to_elim = list(
                  freq_df.loc[found_subgrams][
                      lambda df: row.Count
                      > df.Count * self.usage_portion
                  ].index
              )
              if to_elim:
                  # print(to_elim)
                  eliminations += to_elim
                  eliminators += [row.name] * len(to_elim)
      return pd.DataFrame(
          {"Eliminations": eliminations, "Eliminators": eliminators}
      )
  
file_path: scattertext/scattertext/termcompaction/ngram_percentage_compactor.py
imports: import abc
  import pandas
  from tqdm.auto import tqdm
  from scattertext.TermDocMatrixWithoutCategories import TermDocMatrixWithoutCategories
  from scattertext.features.featoffsets.flexible_ngram_features import sequence_window
  from scattertext.termranking import AbsoluteFrequencyRanker
label_desc: Use image node_id 3 for calling the NgramPercentageCompactor obj's underlying member method code with example usage: obj.get_elimination_df(term_doc_matrix, non_text) and returns: pd