code: def _token_table(
      topic_info, term_topic_freq, vocab, term_frequency, start_index=1
  ):
      # last, to compute the areas of the circles when a term is highlighted
      # we must gather all unique terms that could show up (for every combination
      # of topic and value of lambda) and compute its distribution over topics.
  
      # term-topic frequency table of unique terms across all topics and all values of lambda
      term_ix = topic_info.index.unique()
      term_ix = np.sort(term_ix)
  
      top_topic_terms_freq = term_topic_freq[term_ix]
      # use the new ordering for the topics
      K = len(term_topic_freq)
      top_topic_terms_freq.index = range(start_index, K + start_index)
      top_topic_terms_freq.index.name = "Topic"
  
      # we filter to Freq >= 0.5 to avoid sending too much data to the browser
      token_table = (
          pd.DataFrame({"Freq": top_topic_terms_freq.unstack()})
          .reset_index()
          .set_index("term")
          .query("Freq >= 0.5")
      )
  
      token_table["Freq"] = token_table["Freq"].round()
      token_table["Term"] = vocab[token_table.index.values].values
      # Normalize token frequencies:
      token_table["Freq"] = (
          token_table.Freq / term_frequency[token_table.index]
      )
      return token_table.sort_values(by=["Term", "Topic"])
  
imports: import json
  import logging
  import numpy
  import pandas
  from collections import namedtuple
  from joblib import Parallel, delayed, cpu_count
  from scipy.stats import entropy
  from scipy.spatial.distance import pdist, squareform
  from sklearn.manifold import MDS, TSNE
  from pyLDAvis.utils import NumPyEncoder
label_desc: Use image node_id 17 for calling a global function with example usage: _token_table(topic_info, term_topic_freq, vocab, term_frequency, start_index) and returns: token_table