code: def test_include_term_category_counts(self):
      corpus = build_hamlet_jz_corpus().get_unigram_corpus()
      j = ScatterChartExplorer(
          corpus, minimum_term_frequency=0
      ).to_dict("hamlet", include_term_category_counts=True)
      self.assertEqual(
          set(j.keys()), set(["info", "data", "docs", "termCounts"])
      )
      self.assertEqual(
          len(j["termCounts"]), corpus.get_num_categories()
      )
      term_idx_set = set()
      for cat_counts in j["termCounts"]:
          term_idx_set |= set(cat_counts.keys())
          self.assertTrue(
              all([freq >= docs for freq, docs in cat_counts.values()])
          )
      self.assertEqual(len(term_idx_set), corpus.get_num_terms())
  
file_path: scattertext/scattertext/test/test_scatterChartExplorer.py
imports: import random
  from unittest import TestCase
  import numpy
  from scattertext.ScatterChartExplorer import ScatterChartExplorer
  from scattertext.test.test_semioticSquare import get_test_corpus
  from scattertext.test.test_termDocMatrixFactory import build_hamlet_jz_corpus, build_hamlet_jz_corpus_with_meta, build_hamlet_jz_corpus_with_alt_text
label_desc: Use image node_id 3 for calling the TestScatterChartExplorer obj's underlying member method code with example usage: obj.test_include_term_category_counts() without return types