code: def __get_term_ranks_and_frequencies(
      self, term_doc_matrix
  ) -> Tuple[pd.DataFrame, pd.Series]:
      ranker = self.term_ranker(term_doc_matrix)
      if self.use_non_text_features:
          ranker = ranker.use_non_text_features()
      tdf = ranker.get_ranks("")
      tdf_sum = tdf.sum(axis=1)
      return tdf, tdf_sum
  
imports: from typing import Optional, Tuple
  import pandas
  import numpy
  from scattertext.termscoring.CorpusBasedTermScorer import CorpusBasedTermScorer
  from scipy.stats import rankdata
  from scattertext.termranking.AbsoluteFrequencyRanker import AbsoluteFrequencyRanker
  from scattertext.termscoring.ScaledFScore import ScaledFScorePresetsNeg1To1
label_desc: Use image node_id 5 for calling the TermCategoryRanker obj's underlying member method code with example usage: obj.__get_term_ranks_and_frequencies(term_doc_matrix) and returns: tdf,  tdf_sum