evaluate_result.py 文件源码

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

项目:entity_binding 作者: JasperGuo 项目源码 文件源码
def main(log_file, table_file):
    """
    :param log_file:
    :param table_file:
    :return:
    """
    tables = read_tables(table_file)
    table_dict = build_table_dict(tables)
    questions = read_log(log_file)
    truth = list()
    prediction = list()
    for q in questions:
        process(q, table_dict[q["tid"]])
        t, p = recalc_index(q)
        truth += t
        prediction += p

    file_base_name = os.path.basename(log_file)
    dirname = os.path.dirname(log_file)
    file = os.path.join(dirname, "processed_" + file_base_name)
    report = classification_report(truth, prediction, target_names=["PAT", "LIT", "TAB", "COL", "CELL"])
    save(questions, report, file)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号