conll.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:yaset 作者: jtourille 项目源码 文件源码
def build_report(counts):

    overall, by_type = metrics(counts)

    x = PrettyTable()
    x.field_names = ["Category", "P", "R", "F1"]

    x.add_row(["OVERALL", "{:02.2f}".format((100. * overall.prec)), "{:02.2f}".format((100. * overall.rec)),
               "{:02.2f}".format((100. * overall.fscore))])

    for i, m in sorted(by_type.items()):
        x.add_row([i, "{:02.2f}".format((100. * m.prec)), "{:02.2f}".format((100. * m.rec)),
                   "{:02.2f}".format((100. * m.fscore))])

    x.align["Category"] = "r"

    return x
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号