D3V1L1810 commited on
Commit
7a437ab
·
verified ·
1 Parent(s): 8428754

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -36,7 +36,7 @@ def predict_text(params):
36
  return {"error": "Missing required parameters: 'texts'"}
37
 
38
  solutions = []
39
- confidence_threshold = 0.5 # Define your confidence threshold
40
 
41
  for text, file_id in zip(texts, file_ids):
42
  encoding = bert_tokenizer.encode_plus(
@@ -60,7 +60,7 @@ def predict_text(params):
60
 
61
  # Get the confidence score for the predicted label
62
  confidence = softmax_scores[pred_label]
63
-
64
  # If confidence is below the threshold, set answer to None
65
  if confidence < confidence_threshold:
66
  pred_label = 7 # Set to 'None' class
 
36
  return {"error": "Missing required parameters: 'texts'"}
37
 
38
  solutions = []
39
+ confidence_threshold = 0.85 # Define your confidence threshold
40
 
41
  for text, file_id in zip(texts, file_ids):
42
  encoding = bert_tokenizer.encode_plus(
 
60
 
61
  # Get the confidence score for the predicted label
62
  confidence = softmax_scores[pred_label]
63
+ print(confidence)
64
  # If confidence is below the threshold, set answer to None
65
  if confidence < confidence_threshold:
66
  pred_label = 7 # Set to 'None' class