class_docstr: Sentence LDA Document, inherited from LDADoc.
  Add add_sentence interface.
class_docstr_tok: ["Sentence","LDA","Document",",","inherited","from","LDADoc",".","Add","add_sentence","interface","."]
code: def set_topic(self, index, new_topic):
      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.__sentences[index].topic
      if new_topic == old_topic:
          return
      self.__sentences[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 4 for calling the SLDADoc obj's underlying member method code with example usage: obj.set_topic(index, new_topic) without return types