#NEWLINE# def train( self , corpus ) : #NEWLINE# #INDENT# self . convert_input ( corpus , infer = False ) #NEWLINE# cmd = ( self . mallet_path + ' train-topics --input %s --num-topics %s --optimize-interval %s --num-threads %s --output-state %s --output-doc-topics %s --output-topic-keys %s --num-iterations %s --inferencer-filename %s' ) #NEWLINE# cmd = ( cmd % ( self . fcorpusmallet ( ) , self . num_topics , cmd . optimize_interval , self . workers , self . fstate ( ) , self . fdoctopics ( ) , self . ftopickeys ( ) , self . iterations , self . finferencer ( ) ) ) #NEWLINE# logger . info ( ( 'training MALLET LDA with %s' % cmd ) ) #NEWLINE# call ( cmd , shell = True ) #NEWLINE# self . word_topics = self . load_word_topics ( )