class_docstr: The constructor estimates the author-topic model parameters based on a training corpus.
class_docstr_tok: ["The","constructor","estimates","the","author-topic","model","parameters","based","on","a","training","corpus","."]
docstr: Add new documents from `corpus` to `self.corpus`.
  
  If serialization is used, then the entire corpus (`self.corpus`) is re-serialized and the new documents
  are added in the process. If serialization is not used, the corpus, as a list of documents, is simply extended.
  
  Parameters
  ----------
  corpus : iterable of list of (int, float)
      Corpus in BoW format
  
  Raises
  ------
  AssertionError
      If serialized == False and corpus isn't list.
docstr_tok: ["Add","new","documents","from","`","corpus","`","to","`","self.corpus","`",".","If","serialization","is","used",",","then","the","entire","corpus","(","`","self.corpus","`",")","is","re-serialized","and","the","new","documents","are","added","in","the","process",".","If","serialization","is","not","used",",","the","corpus",",","as","a","list","of","documents",",","is","simply","extended",".","Parameters","--","--","--","--","--","corpus",":","iterable","of","list","of","(","int",",","float",")","Corpus","in","BoW","format","Raises","--","--","--","AssertionError","If","serialized","==","False","and","corpus","is","n't","list","."]
code: def extend_corpus(self, corpus):
      """Add new documents from `corpus` to `self.corpus`.
  
      If serialization is used, then the entire corpus (`self.corpus`) is re-serialized and the new documents
      are added in the process. If serialization is not used, the corpus, as a list of documents, is simply extended.
  
      Parameters
      ----------
      corpus : iterable of list of (int, float)
          Corpus in BoW format
  
      Raises
      ------
      AssertionError
          If serialized == False and corpus isn't list.
  
      """
      if self.serialized:
          # Re-serialize the entire corpus while appending the new documents.
          if isinstance(corpus, MmCorpus):
              # Check that we are not attempting to overwrite the serialized corpus.
              assert (
                  self.corpus.input != corpus.input
              ), "Input corpus cannot have the same file path as the model corpus (serialization_path)."
          corpus_chain = chain(
              self.corpus, corpus
          )  # A generator with the old and new documents.
          # Make a temporary copy of the file where the corpus is serialized.
          copyfile(
              self.serialization_path, self.serialization_path + ".tmp"
          )
          self.corpus.input = (
              self.serialization_path + ".tmp"
          )  # Point the old corpus at this temporary file.
          # Re-serialize the old corpus, and extend it with the new corpus.
          MmCorpus.serialize(self.serialization_path, corpus_chain)
          self.corpus = MmCorpus(
              self.serialization_path
          )  # Store the new serialized corpus object in self.corpus.
          remove(
              self.serialization_path + ".tmp"
          )  # Remove the temporary file again.
      else:
          # self.corpus and corpus are just lists, just extend the list.
          # First check that corpus is actually a list.
          assert isinstance(
              corpus, list
          ), "If serialized == False, all input corpora must be lists."
          self.corpus.extend(corpus)
  
imports: import logging
  from itertools import chain
  from copy import deepcopy
  from shutil import copyfile
  from os.path import isfile
  from os import remove
  import numpy
  from scipy.special import gammaln
  from gensim import utils
  from gensim.models import LdaModel
  from gensim.models.ldamodel import LdaState
  from gensim.matutils import dirichlet_expectation, mean_absolute_difference
  from gensim.corpora import MmCorpus
label_desc: Use image node_id 4 for calling the AuthorTopicModel obj's underlying member method code with example usage: obj.extend_corpus(corpus) without return types