示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)