INNER CODE UNIT · Python
pt_f
taishi-i/nagisa · nagisa/mecab_system_eval.py:103
pt_f = round(2*pt_p*pt_r/(pt_p+pt_r), 4)
return [ws_p, ws_r, ws_f, pt_p, pt_r, pt_f]
def print_eval(r):
ws_c, pt_c, prec, recall = r
ws_p, ws_r, ws_f, pt_p, pt_r, pt_f = calculate_fvalues(r)
ws_p_out = str(ws_p)+"("+str(ws_c)+"/"+str(prec)+")"
ws_r_out = str(ws_r)+"("+str(ws_c)+"/"+str(recall)+")"
pt_p_out = str(pt_p)+"("+str(pt_c)+"/"+str(prec)+")"
pt_r_out = str(pt_r)+"("+str(pt_c)+"/"+str(recall)+")"
ws_out = ["LEVEL 0:", ws_p_out, ws_r_out, str(ws_f)]
pt_out = ["LEVEL ALL:", pt_p_out, pt_r_out, str(pt_f)]
header = [" ", "precision", "recall", "F"]