class_docstr: The storage structure of LDA model's inference result.
      
class_docstr_tok: ["The","storage","structure","of","LDA","model","'s","inference","result","."]
docstr: Return the topic distribution of documents in sparse format.
  By default, it is sorted according to the topic probability
  under the descending order.
docstr_tok: ["Return","the","topic","distribution","of","documents","in","sparse","format",".","By","default",",","it","is","sorted","according","to","the","topic","probability","under","the","descending","order","."]
code: def sparse_topic_dist(self, sort=True):
      """Return the topic distribution of documents in sparse format.
      By default, it is sorted according to the topic probability
      under the descending order.
      """
      topic_dist = []
      sum_ = np.sum(self._accum_topic_sum)
      if sum_ == 0:
          return topic_dist
      for i in range(0, self._num_topics):
          if self._accum_topic_sum[i] == 0:
              continue
          topic_dist.append(
              Topic(i, self._accum_topic_sum[i] * 1.0 / sum_)
          )
      if sort:
  
          def take_elem(topic):
              return topic.prob
  
          topic_dist.sort(key=take_elem, reverse=True)
          if topic_dist is None:
              topic_dist = []
  
      return topic_dist
  
imports: import numpy
label_desc: Use image node_id 9 for calling the LDADoc obj's underlying member method code with example usage: obj.sparse_topic_dist(sort) and returns: topic_dist, topic_dist, topic