diff --git a/examples/multi-task/evaluate-intent.py b/examples/multi-task/evaluate-intent.py index 7c491cdd372cba85f178b406b5eb4655712b215f..5d2feb5e9f6c8344f29a14c3bfbd7b12240cbad8 100644 --- a/examples/multi-task/evaluate-intent.py +++ b/examples/multi-task/evaluate-intent.py @@ -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