class_docstr: The storage structure of LDA model's inference result.
      
class_docstr_tok: ["The","storage","structure","of","LDA","model","'s","inference","result","."]
docstr: Set the index word's topic to new_topic, and update the corresponding
  topic distribution.
docstr_tok: ["Set","the","index","word","'s","topic","to","new_topic",",","and","update","the","corresponding","topic","distribution","."]
code: def set_topic(self, index, new_topic):
      """Set the index word's topic to new_topic, and update the corresponding
      topic distribution.
      """
      assert new_topic >= 0, "Topic %d out of range!" % new_topic
      assert new_topic < self._num_topics, (
          "Topic %d out of range!" % new_topic
      )
      old_topic = self._tokens[index].topic
      if new_topic == old_topic:
          return
      self._tokens[index].topic = new_topic
      self._topic_sum[old_topic] -= 1
      self._topic_sum[new_topic] += 1
  
imports: import numpy
label_desc: Use image node_id 5 for calling the LDADoc obj's underlying member method code with example usage: obj.set_topic(index, new_topic) without return types