main.py 文件源码

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

项目:user-factor-adaptation 作者: StonyBrookNLP 项目源码 文件源码
def compute_f1(predictions, labels):
    """
    Compute the F1 for FAVOR and AGAINST classes, as well as the average of the two.
    """
    _, _, f1, _ = precision_recall_fscore_support(labels, predictions,
                                                  warn_for=("f1"))
    f1_against = f1[0]
    f1_favor = f1[2]
    f1_overall = (f1_against + f1_favor) / 2
    return f1_against, f1_favor, f1_overall
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号