class_docstr: Train and use Online Latent Dirichlet Allocation model as presented in
  `'Online Learning for LDA' by Hoffman et al.`_
  
  Examples
  -------
  Initialize a model using a Gensim corpus
  
  .. sourcecode:: pycon
  
      >>> from gensim.test.utils import common_corpus
      >>>
      >>> lda = LdaModel(common_corpus, num_topics=10)
  
  You can then infer topic distributions on new, unseen documents.
  
  .. sourcecode:: pycon
  
      >>> doc_bow = [(1, 0.3), (2, 0.1), (0, 0.09)]
      >>> doc_lda = lda[doc_bow]
  
  The model can be updated (trained) with new documents.
  
  .. sourcecode:: pycon
  
      >>> # In practice (corpus =/= initial training corpus), but we use the same here for simplicity.
      >>> other_corpus = common_corpus
      >>>
      >>> lda.update(other_corpus)
  
  Model persistency is achieved through :meth:`~gensim.models.ldamodel.LdaModel.load` and
  :meth:`~gensim.models.ldamodel.LdaModel.save` methods.
class_docstr_tok: ["Train","and","use","Online","Latent","Dirichlet","Allocation","model","as","presented","in","`","'Online","Learning","for","LDA","'","by","Hoffman","et","al.","`","_","Examples","--","--","--","-","Initialize","a","model","using","a","Gensim","corpus","..","sourcecode",":",":","pycon",">",">",">","from","gensim.test.utils","import","common_corpus",">",">",">",">",">",">","lda","=","LdaModel","(","common_corpus",",","num_topics=10",")","You","can","then","infer","topic","distributions","on","new",",","unseen","documents",".","..","sourcecode",":",":","pycon",">",">",">","doc_bow","=","[","(","1",",","0.3",")",",","(","2",",","0.1",")",",","(","0",",","0.09",")","]",">",">",">","doc_lda","=","lda","[","doc_bow","]","The","model","can","be","updated","(","trained",")","with","new","documents",".","..","sourcecode",":",":","pycon",">",">",">","#","In","practice","(","corpus","=\/=","initial","training","corpus",")",",","but","we","use","the","same","here","for","simplicity",".",">",">",">","other_corpus","=","common_corpus",">",">",">",">",">",">","lda.update","(","other_corpus",")","Model","persistency","is","achieved","through",":","meth",":","`","~gensim.models.ldamodel.LdaModel.load","`","and",":","meth",":","`","~gensim.models.ldamodel.LdaModel.save","`","methods","."]
docstr: Get the most relevant topics to the given word.
  
  Parameters
  ----------
  word_id : int
      The word for which the topic distribution will be computed.
  minimum_probability : float, optional
      Topics with an assigned probability below this threshold will be discarded.
  
  Returns
  -------
  list of (int, float)
      The relevant topics represented as pairs of their ID and their assigned probability, sorted
      by relevance to the given word.
docstr_tok: ["Get","the","most","relevant","topics","to","the","given","word",".","Parameters","--","--","--","--","--","word_id",":","int","The","word","for","which","the","topic","distribution","will","be","computed",".","minimum_probability",":","float",",","optional","Topics","with","an","assigned","probability","below","this","threshold","will","be","discarded",".","Returns","--","--","--","-","list","of","(","int",",","float",")","The","relevant","topics","represented","as","pairs","of","their","ID","and","their","assigned","probability",",","sorted","by","relevance","to","the","given","word","."]
code: def get_term_topics(self, word_id, minimum_probability=None):
      """Get the most relevant topics to the given word.
  
      Parameters
      ----------
      word_id : int
          The word for which the topic distribution will be computed.
      minimum_probability : float, optional
          Topics with an assigned probability below this threshold will be discarded.
  
      Returns
      -------
      list of (int, float)
          The relevant topics represented as pairs of their ID and their assigned probability, sorted
          by relevance to the given word.
  
      """
      if minimum_probability is None:
          minimum_probability = self.minimum_probability
      minimum_probability = max(
          minimum_probability, 1e-8
      )  # never allow zero values in sparse output
  
      # if user enters word instead of id in vocab, change to get id
      if isinstance(word_id, str):
          word_id = self.id2word.doc2bow([word_id])[0][0]
  
      values = []
      for topic_id in range(0, self.num_topics):
          if self.expElogbeta[topic_id][word_id] >= minimum_probability:
              values.append(
                  (topic_id, self.expElogbeta[topic_id][word_id])
              )
  
      return values
  
imports: import logging
  import numbers
  import os
  import time
  from collections import defaultdict
  import numpy
  from scipy.special import gammaln, psi
  from scipy.special import polygamma
  from gensim import interfaces, utils, matutils
  from gensim.matutils import kullback_leibler, hellinger, jaccard_distance, jensen_shannon, dirichlet_expectation, logsumexp, mean_absolute_difference
  from gensim.models import basemodel, CoherenceModel
  from gensim.models.callbacks import Callback
label_desc: Use image node_id 20 for calling the LdaModel obj's underlying member method code with example usage: obj.get_term_topics(word_id, minimum_probability) and returns: values