@gensim.utils.synchronous('<STR_LIT>')<EOL><INDENT>def train(self, corpus=None, method='<STR_LIT>', clear_buffer=True, params=None):<DEDENT>
if corpus is not None:<EOL><INDENT>self.flush(clear_buffer=True)<EOL>self.buffer(corpus)<EOL><DEDENT>if not self.fresh_docs:<EOL><INDENT>msg = "<STR_LIT>" % self<EOL>logger.error(msg)<EOL>raise ValueError(msg)<EOL><DEDENT>if method == '<STR_LIT>':<EOL><INDENT>numdocs = len(self.fresh_docs)<EOL>if numdocs < <NUM_LIT:1000>:<EOL><INDENT>logging.warning("<STR_LIT>")<EOL>method = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>method = '<STR_LIT>'<EOL><DEDENT><DEDENT>if params is None:<EOL><INDENT>params = {}<EOL><DEDENT>self.model = SimModel(self.fresh_docs, method=method, params=params)<EOL>self.flush(save_model=True, clear_buffer=clear_buffer)<EOL>
Create an indexing model. Will overwrite the model if it already exists.
All indexes become invalid, because documents in them use a now-obsolete
representation.

The model is trained on documents previously entered via `buffer`,
or directly on `corpus`, if specified.