util.py 文件源码

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

项目:DeepLearn 作者: GauravBh1010tt 项目源码 文件源码
def save_predictions(pred, file):

    """
    Save predictions to CSV file
    Args:
        pred: numpy array, of numeric predictions
        file: str, filename + extension
    """

    with open(file, 'w') as csvfile:
        fieldnames = ['Stance']
        writer = DictWriter(csvfile, fieldnames=fieldnames)

        writer.writeheader()
        for instance in pred:
            writer.writerow({'Stance': label_ref_rev[instance]})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号