提交 073d3319 编写于 作者: W wangxiao1021

update evaluate-intent.py

上级 b60e6fd5
......@@ -15,7 +15,7 @@ def f1(preds, labels):
tn = np.sum((labels == '0') & (preds == '0'))
fp = np.sum((labels == '0') & (preds == '1'))
fn = np.sum((labels == '1') & (preds == '0'))
p = tp * 1.0 / (tp + fp)
p = tp * 1.0 / (tp + fp) * 1.0
r = tp * 1.0 / (tp + fn) * 1.0
f1 = (2 * p * r) / (p + r + 1e-8)
return f1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册