class_docstr: Model for `Latent Semantic Indexing
  <https://en.wikipedia.org/wiki/Latent_semantic_analysis#Latent_semantic_indexing>`_.
  
  The decomposition algorithm is described in `"Fast and Faster: A Comparison of Two Streamed
  Matrix Decomposition Algorithms" <https://arxiv.org/pdf/1102.5597.pdf>`_.
  
  Notes
  -----
  * :attr:`gensim.models.lsimodel.LsiModel.projection.u` - left singular vectors,
  * :attr:`gensim.models.lsimodel.LsiModel.projection.s` - singular values,
  * ``model[training_corpus]`` - right singular vectors (can be reconstructed if needed).
  
  See Also
  --------
  `FAQ about LSI matrices
  <https://github.com/RaRe-Technologies/gensim/wiki/Recipes-&-FAQ#q4-how-do-you-output-the-u-s-vt-matrices-of-lsi>`_.
  
  Examples
  --------
  .. sourcecode:: pycon
  
      >>> from gensim.test.utils import common_corpus, common_dictionary, get_tmpfile
      >>> from gensim.models import LsiModel
      >>>
      >>> model = LsiModel(common_corpus[:3], id2word=common_dictionary)  # train model
      >>> vector = model[common_corpus[4]]  # apply model to BoW document
      >>> model.add_documents(common_corpus[4:])  # update model with new documents
      >>> tmp_fname = get_tmpfile("lsi.model")
      >>> model.save(tmp_fname)  # save model
      >>> loaded_model = LsiModel.load(tmp_fname)  # load model
class_docstr_tok: ["Model","for","`","Latent","Semantic","Indexing","<","https",":","\/\/en.wikipedia.org\/wiki\/Latent_semantic_analysis","#","Latent_semantic_indexing",">","`","_",".","The","decomposition","algorithm","is","described","in","`","``","Fast","and","Faster",":","A","Comparison","of","Two","Streamed","Matrix","Decomposition","Algorithms","''","<","https",":","\/\/arxiv.org\/pdf\/1102.5597.pdf",">","`","_",".","Notes","--","--","-","*",":","attr",":","`","gensim.models.lsimodel.LsiModel.projection.u","`","-","left","singular","vectors",",","*",":","attr",":","`","gensim.models.lsimodel.LsiModel.projection.s","`","-","singular","values",",","*","``","model","[","training_corpus","]","``","-","right","singular","vectors","(","can","be","reconstructed","if","needed",")",".","See","Also","--","--","--","--","`","FAQ","about","LSI","matrices","<","https",":","\/\/github.com\/RaRe-Technologies\/gensim\/wiki\/Recipes-","&","-FAQ","#","q4-how-do-you-output-the-u-s-vt-matrices-of-lsi",">","`","_",".","Examples","--","--","--","--","..","sourcecode",":",":","pycon",">",">",">","from","gensim.test.utils","import","common_corpus",",","common_dictionary",",","get_tmpfile",">",">",">","from","gensim.models","import","LsiModel",">",">",">",">",">",">","model","=","LsiModel","(","common_corpus","[",":3","]",",","id2word=common_dictionary",")","#","train","model",">",">",">","vector","=","model","[","common_corpus","[","4","]","]","#","apply","model","to","BoW","document",">",">",">","model.add_documents","(","common_corpus","[","4",":","]",")","#","update","model","with","new","documents",">",">",">","tmp_fname","=","get_tmpfile","(","``","lsi.model","''",")",">",">",">","model.save","(","tmp_fname",")","#","save","model",">",">",">","loaded_model","=","LsiModel.load","(","tmp_fname",")","#","load","model"]
docstr: Get the words that define a topic along with their contribution.
  
  This is actually the left singular vector of the specified topic.
  
  The most important words in defining the topic (greatest absolute value) are included
  in the output, along with their contribution to the topic.
  
  Parameters
  ----------
  topicno : int
      The topics id number.
  topn : int
      Number of words to be included to the result.
  
  Returns
  -------
  list of (str, float)
      Topic representation in BoW format.
docstr_tok: ["Get","the","words","that","define","a","topic","along","with","their","contribution",".","This","is","actually","the","left","singular","vector","of","the","specified","topic",".","The","most","important","words","in","defining","the","topic","(","greatest","absolute","value",")","are","included","in","the","output",",","along","with","their","contribution","to","the","topic",".","Parameters","--","--","--","--","--","topicno",":","int","The","topics","id","number",".","topn",":","int","Number","of","words","to","be","included","to","the","result",".","Returns","--","--","--","-","list","of","(","str",",","float",")","Topic","representation","in","BoW","format","."]
code: def show_topic(self, topicno, topn=10):
      """Get the words that define a topic along with their contribution.
  
      This is actually the left singular vector of the specified topic.
  
      The most important words in defining the topic (greatest absolute value) are included
      in the output, along with their contribution to the topic.
  
      Parameters
      ----------
      topicno : int
          The topics id number.
      topn : int
          Number of words to be included to the result.
  
      Returns
      -------
      list of (str, float)
          Topic representation in BoW format.
  
      """
      # size of the projection matrix can actually be smaller than `self.num_topics`,
      # if there were not enough factors (real rank of input matrix smaller than
      # `self.num_topics`). in that case, return an empty string
      if topicno >= len(self.projection.u.T):
          return ""
      c = np.asarray(self.projection.u.T[topicno, :]).flatten()
      norm = np.sqrt(np.sum(np.dot(c, c)))
      most = matutils.argsort(np.abs(c), topn, reverse=True)
  
      # Output only (word, score) pairs for `val`s that are within `self.id2word`.  See #3090 for details.
      return [
          (self.id2word[val], 1.0 * c[val] / norm)
          for val in most
          if val in self.id2word
      ]
  
imports: import logging
  import sys
  import time
  import numpy
  import scipy.linalg
  import scipy.sparse
  from scipy.sparse import sparsetools
  from gensim import interfaces, matutils, utils
  from gensim.models import basemodel
  from gensim.utils import is_empty
label_desc: Use image node_id 6 for calling the LsiModel obj's underlying member method code with example usage: obj.show_topic(topicno, topn) and returns: unknown, str