def test_baum_welch_mp(self): """ Does the same as L{test_baum_welch}, but uses multiprocessing. """ options = BaumWelchTrainer.process_option_dict({'trainprocs': -1}) trainer = BaumWelchTrainer(self.model, options) # Train the model with Baum Welch trainer.train(self.TRAINING_DATA)
def test_baum_welch_mp(self): """ Does the same as L{test_baum_welch}, but uses multiprocessing. """ options = BaumWelchTrainer.process_option_dict({'trainprocs':-1}) trainer = BaumWelchTrainer(self.model, options) # Train the model with Baum Welch trainer.train(self.TRAINING_DATA)
def test_baum_welch(self): """ Runs the Baum Welch trainer using the training data. """ options = BaumWelchTrainer.process_option_dict({}) trainer = BaumWelchTrainer(self.model, options) # Train the model with Baum Welch trainer.train(self.TRAINING_DATA) model = trainer.model # Try decoding using the trained model to check it still works model.viterbi_decode(self.TEST_DATA)