Skip to content
Snippets Groups Projects
Commit 32955188 authored by Nils W's avatar Nils W
Browse files

19

parent ae4edc4b
No related branches found
No related tags found
No related merge requests found
......@@ -328,6 +328,10 @@ def calc_f_score_smatch(name, one, two, smatch_pred, graph_source, graph_summary
def calc_precision_smatch(name, one, two, smatch_pred, graph_source, graph_summary):
if smatch_pred[1] == 0:
safe_smatch_error(name=name, one=one, two=two, result=0, smatch_pred=smatch_pred,
graph_source=graph_source, graph_summary=graph_summary)
return 0
precision = smatch_pred[0] / smatch_pred[1]
if 1 < precision:
safe_smatch_error(name=name, one=one, two=two, result=precision, smatch_pred=smatch_pred,
......@@ -337,6 +341,10 @@ def calc_precision_smatch(name, one, two, smatch_pred, graph_source, graph_summa
def calc_recall_smatch(name, one, two, smatch_pred, graph_source, graph_summary):
if smatch_pred[2] == 0:
safe_smatch_error(name=name, one=one, two=two, result=0, smatch_pred=smatch_pred,
graph_source=graph_source, graph_summary=graph_summary)
return 0
recall = smatch_pred[0] / smatch_pred[2]
if 1 < recall:
safe_smatch_error(name=name, one=one, two=two, result=recall, smatch_pred=smatch_pred,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment