本文整理汇总了Python中hmm.HMM.get_theta方法的典型用法代码示例。如果您正苦于以下问题:Python HMM.get_theta方法的具体用法?Python HMM.get_theta怎么用?Python HMM.get_theta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hmm.HMM
的用法示例。
在下文中一共展示了HMM.get_theta方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: hmm_train
# 需要导入模块: from hmm import HMM [as 别名]
# 或者: from hmm.HMM import get_theta [as 别名]
def hmm_train(results):
train_file = results.train
freq_file = results.freq
logger.debug( 'Started training HMM with options:' + "\n" +
'training file: ' + str(train_file) + "\n" +
'frequency file:' + str(freq_file) + "\n")
if not os.path.exists('model/hmm-model'):
classifier = HMM()
classifier.train(train_file,freq_file)
logger.info("Done Training, model is written in model file")
model = classifier.get_theta()
write_obj(model, 'hmm-model')
else:
logger.info('model already exists, nothing to do!')