Skip to content

Commit

Permalink
Merge pull request #48 from LiyuanLucasLiu/LiyuanLucasLiu-patch-1
Browse files Browse the repository at this point in the history
Update evaluator.py
  • Loading branch information
LiyuanLucasLiu committed Sep 26, 2018
2 parents 0fa252b + be6e592 commit 533df89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model/evaluator.py
Expand Up @@ -100,11 +100,11 @@ def f1_score(self):
calculate f1 score based on statics
"""
if self.guess_count == 0:
return 0.0, 0.0, 0.0, 0.0
return {'total': (0.0, 0.0, 0.0, 0.0)}
precision = self.overlap_count / float(self.guess_count)
recall = self.overlap_count / float(self.gold_count)
if precision == 0.0 or recall == 0.0:
return 0.0, 0.0, 0.0, 0.0
return {'total', (0.0, 0.0, 0.0, 0.0)}
f = 2 * (precision * recall) / (precision + recall)
accuracy = float(self.correct_labels) / self.total_labels
message=""
Expand Down

0 comments on commit 533df89

Please sign in to comment.