utils.py 文件源码

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

项目:pyNTCIREVAL 作者: mpkato 项目源码 文件源码
def compute_validation(j, grades, stops, beta, gamma, logb, rbp,
    xrelnum, jrelnum):
    if len(stops) != len(grades):
        raise click.BadParameter("the size of '-s' must be the same as '-g'")
    if beta < 0:
        raise click.BadParameter("the value of '--beta' must be positive")
    if gamma < 0 or gamma > 1:
        raise click.BadParameter("the value of '--gamma' must range from 0 to 1")
    if logb < 0:
        raise click.BadParameter(
            "the value of '--logb' must be 0 (natural log) or more")
    if rbp < 0 or rbp > 1:
        raise click.BadParameter("the value of '--rbp' must range from 0 to 1")
    # TODO: bug report
    # THIS EXCEPTION SHOULD NOT BE RAISED
    #if j and xrelnum[0] == 0:
    #    raise Exception("No judged nonrel: bpref etc. not computable")
    if jrelnum == 0:
        raise Exception(
            "No relevance document found in the relevance assessment file")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号