Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
haoxizhong committed May 23, 2018
1 parent e4afdec commit 12df034
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions judger/judger.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, accusation_path, law_path):

# Format the result generated by the Predictor class
@staticmethod
def format_result(self, result):
def format_result(result):
if not (type(result) is dict):
return {"accusation": [], "articles": [], "imprisonment": -3}

Expand Down Expand Up @@ -132,7 +132,7 @@ def gen_new_result(self, result, truth, label):
# Calculate precision, recall and f1 value
# According to https://github.com/dice-group/gerbil/wiki/Precision,-Recall-and-F1-measure
@staticmethod
def get_value(self, res):
def get_value(res):
if res["TP"] == 0:
if res["FP"] == 0 and res["FN"] == 0:
precision = 1.0
Expand Down

0 comments on commit 12df034

Please sign in to comment.