当前位置: 首页>>代码示例>>Python>>正文


Python A.compute_avg_aer方法代码示例

本文整理汇总了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))
开发者ID:actondong,项目名称:NLP,代码行数:13,代码来源:B.py

示例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))
开发者ID:phoebe996,项目名称:NLP_HW4,代码行数:9,代码来源:B.py

示例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))
开发者ID:jxWho,项目名称:h4,代码行数:12,代码来源:EC.py

示例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'
开发者ID:Xochitlxie,项目名称:EECS595-NLP,代码行数:12,代码来源:B.py

示例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))
开发者ID:williamFalcon,项目名称:NLP_HW4,代码行数:13,代码来源:B.py

示例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))
开发者ID:williamFalcon,项目名称:NLP_HW4,代码行数:13,代码来源:EC.py

示例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'
开发者ID:Xochitlxie,项目名称:EECS595-NLP,代码行数:14,代码来源:EC.py


注:本文中的A.compute_avg_aer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。