code: def topic_content(self, W, output_file="topic_description.csv"):
  
          
  
          topic_top_probs = []
          topic_top_words = []
  
          tt = self.tt_avg(False)
  
          for t in range(self.K):            
              top_word_indices = list(tt[:, t].argsort()[-W:][::-1])
              topic_top_probs.append(np.round(np.sort(tt[:, t])[-W:][::-1], 3))
              topic_top_words.append([list(self.token_key.keys())
                                     [list(self.token_key.values()).index(i)]
                                     for i in top_word_indices])            
  
          with codecs.open(output_file, "w", "utf-8") as f:
              for t in range(self.K):                
                  words = ','.join(topic_top_words[t])
                  probs = ','.join([str(i) for i in topic_top_probs[t]])
                  f.write("topic" + str(t) + ',')
                  f.write("%s\n" % words)
                  f.write(" " + ',')
                  f.write("%s\n" % probs)
docs: Print top W words in each topic to file.