retrofit.py 文件源码

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

项目:sota_sentiment 作者: jbarnesspain 项目源码 文件源码
def print_results(file, out_file, file_type):

    names, results, dim = test_embeddings(file, file_type)

    table_data = [[name] + result for name, result in zip(names, results)]
    table = tabulate.tabulate(table_data, headers=['dataset', 'acc', 'prec', 'rec', 'f1'], tablefmt='simple', floatfmt='.3f')

    if out_file:
        with open(out_file, 'a') as f:
            f.write('\n')
            f.write('+++Retrofit+++\n')
            f.write(table)
            f.write('\n')
    else:
        print()
        print('+++Retrofit+++')
        print(table)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号