docstr: Construct alias table for all words.
          
docstr_tok: ["Construct","alias","table","for","all","words","."]
code: def __construct_alias_table(self):
      """Construct alias table for all words."""
      logger.info("Construct alias table for alias sampling method.")
      vocab_size = self.__model.vocab_size()
      self.__topic_indexes = [[] for _ in range(vocab_size)]
      self.__alias_tables = [VoseAlias() for _ in range(vocab_size)]
      self.__prob_sum = np.zeros(vocab_size)
  
      # Construct each word's alias table (prior is not included).
      for i in tqdm(range(vocab_size)):
          dist = []
          prob_sum = 0
          for key in self.__model.word_topic(i):
              topic_id = key
              word_topic_count = self.__model.word_topic(i)[key]
              topic_sum = self.__model.topic_sum_value(topic_id)
  
              self.__topic_indexes[i].append(topic_id)
              q = word_topic_count / (
                  topic_sum + self.__model.beta_sum()
              )
              dist.append(q)
              prob_sum += q
          self.__prob_sum[i] = prob_sum
          if len(dist) > 0:
              dist = np.array(dist, dtype=np.float)
              self.__alias_tables[i].initialize(dist)
  
      # Build prior parameter beta's alias table.
      beta_dist = self.__model.beta() / (
          self.__model.topic_sum() + self.__model.beta_sum()
      )
      self.__beta_prior_sum = np.sum(beta_dist)
      self.__beta_alias.initialize(beta_dist)
  
imports: import os
  import numpy
  from tqdm import tqdm
  from paddlehub.common.logger import logger
  from lda_novel.document import LDADoc, SLDADoc, Token, Sentence
  from lda_novel.vose_alias import VoseAlias
  from lda_novel.util import rand, rand_k
label_desc: Use image node_id 2 for calling the MHSampler obj's underlying member method code with example usage: obj.__construct_alias_table() without return types