本文整理汇总了Python中A.save_model_output方法的典型用法代码示例。如果您正苦于以下问题:Python A.save_model_output方法的具体用法?Python A.save_model_output怎么用?Python A.save_model_output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类A
的用法示例。
在下文中一共展示了A.save_model_output方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import A [as 别名]
# 或者: from A import save_model_output [as 别名]
def main(aligned_sents):
ba = BerkeleyAligner(aligned_sents, 10)
A.save_model_output(aligned_sents, ba, "ba.txt")
avg_aer = A.compute_avg_aer(aligned_sents, ba, 50)
print ('Berkeley Aligner')
print ('---------------------------')
print('Average AER: {0:.3f}\n'.format(avg_aer))
示例2: main
# 需要导入模块: import A [as 别名]
# 或者: from A import save_model_output [as 别名]
def main(aligned_sents):
time.clock()
ba = BerkeleyAligner(aligned_sents, 10)
A.save_model_output(aligned_sents, ba, "ba.txt")
avg_aer = A.compute_avg_aer(aligned_sents, ba, 50)
print ('Berkeley Aligner')
print ('---------------------------')
print('Average AER: {0:.3f}\n'.format(avg_aer))
print "Part B time: " + str(time.clock()) + ' sec'
示例3: main
# 需要导入模块: import A [as 别名]
# 或者: from A import save_model_output [as 别名]
def main(aligned_sents):
ba = BerkeleyAligner(aligned_sents, 10)
A.save_model_output(aligned_sents, ba, "ba.txt")
avg_aer = A.compute_avg_aer(aligned_sents, ba, 50)
#Report aer for each sentence of first 20 sentences
for i,aligned_sent in enumerate(aligned_sents[:20]):
print "ba , aer of sentence "+str(i)+" "+str(A.compute_avg_aer([aligned_sent],ba,1))
print ('Berkeley Aligner')
print ('---------------------------')
print('Average AER: {0:.3f}\n'.format(avg_aer))
示例4: main
# 需要导入模块: import A [as 别名]
# 或者: from A import save_model_output [as 别名]
def main(aligned_sents):
print 'training regular berkeley model'
iters = 10
ba = BerkeleyAligner(aligned_sents, iters)
A.save_model_output(aligned_sents, ba, "ba.txt")
avg_aer = A.compute_avg_aer(aligned_sents, ba, 50, 'berk_errs.txt')
print ('Berkeley Aligner')
print ('iterations:' + str(iters))
print ('---------------------------')
print('Average AER: {0:.3f}\n\n\n'.format(avg_aer))