Gosse Minnema commited on
Commit
f87bc2c
1 Parent(s): adbf6a0

Fix bug in confidence thresholding

Browse files
Files changed (1) hide show
  1. sociolome/lome_webserver.py +2 -2
sociolome/lome_webserver.py CHANGED
@@ -59,7 +59,7 @@ def make_prediction(sentence, spacy_model, predictor, confidence_threshold):
59
  continue
60
  if frm.upper() == frm:
61
  continue
62
- if fr_proba.max() != confidence_threshold:
63
  continue
64
 
65
  arg_spans, arg_labels, label_probas = predictor.force_decode(tokens, parent_span=tgt, parent_label=frm)
@@ -70,7 +70,7 @@ def make_prediction(sentence, spacy_model, predictor, confidence_threshold):
70
  "roles": [
71
  {"boundary": bnd, "label": label}
72
  for bnd, label, probas in zip(arg_spans, arg_labels, label_probas)
73
- if label != "Target" and max(probas) == confidence_threshold
74
  ]
75
  }
76
 
 
59
  continue
60
  if frm.upper() == frm:
61
  continue
62
+ if fr_proba.max() < confidence_threshold:
63
  continue
64
 
65
  arg_spans, arg_labels, label_probas = predictor.force_decode(tokens, parent_span=tgt, parent_label=frm)
 
70
  "roles": [
71
  {"boundary": bnd, "label": label}
72
  for bnd, label, probas in zip(arg_spans, arg_labels, label_probas)
73
+ if label != "Target" and max(probas) < confidence_threshold
74
  ]
75
  }
76