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