本文整理汇总了Python中A.compute_avg_aer方法的典型用法代码示例。如果您正苦于以下问题:Python A.compute_avg_aer方法的具体用法?Python A.compute_avg_aer怎么用?Python A.compute_avg_aer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类A
的用法示例。
在下文中一共展示了A.compute_avg_aer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import A [as 别名]
# 或者: from A import compute_avg_aer [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))
示例2: main
# 需要导入模块: import A [as 别名]
# 或者: from A import compute_avg_aer [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))
示例3: main
# 需要导入模块: import A [as 别名]
# 或者: from A import compute_avg_aer [as 别名]
def main(aligned_sents):
ba = BetterBerkeleyAligner(aligned_sents, 10)
if ba.t is None:
print "Better Berkeley Aligner Not Implemented"
else:
avg_aer = A.compute_avg_aer(aligned_sents, ba, 50)
print ('Better Berkeley Aligner')
print ('---------------------------')
print('Average AER: {0:.3f}\n'.format(avg_aer))
示例4: main
# 需要导入模块: import A [as 别名]
# 或者: from A import compute_avg_aer [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'
示例5: main
# 需要导入模块: import A [as 别名]
# 或者: from A import compute_avg_aer [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))
示例6: main
# 需要导入模块: import A [as 别名]
# 或者: from A import compute_avg_aer [as 别名]
def main(aligned_sents):
stemmed_sents = stem_input_sents(aligned_sents)
ba = BetterBerkeleyAligner(stemmed_sents, 6) #6
if ba.t is None:
print "Better Berkeley Aligner Not Implemented"
else:
avg_aer = A.compute_avg_aer(stemmed_sents, ba, 50, 'ec_errs.txt')
print ('Better Berkeley Aligner')
print ('---------------------------')
print('Average AER: {0:.3f}\n'.format(avg_aer))
示例7: main
# 需要导入模块: import A [as 别名]
# 或者: from A import compute_avg_aer [as 别名]
def main(aligned_sents):
time.clock()
ba = BetterBerkeleyAligner(aligned_sents, 10)
if ba.t is None:
print "Better Berkeley Aligner Not Implemented"
else:
avg_aer = A.compute_avg_aer(aligned_sents, ba, 50)
print ('Better Berkeley Aligner')
print ('---------------------------')
print('Average AER: {0:.3f}\n'.format(avg_aer))
print "Part EC time: " + str(time.clock()) + ' sec'