INNER CODE UNIT · Python

pt_p

taishi-i/nagisa · nagisa/mecab_system_eval.py:98

    pt_p = round(100*pt_c/prec, 4)
    pt_r = round(100*pt_c/recall, 4)
    if pt_p+pt_r == 0:
        pt_f = round(0., 4)
    else:
        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)+")"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…