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)
评论列表
文章目录