HMPhuoc commited on
Commit
4d2949d
1 Parent(s): 518d46d

fix bert complete

Browse files
Files changed (2) hide show
  1. app.py +2 -3
  2. phoBERT.py +0 -1
app.py CHANGED
@@ -114,9 +114,8 @@ def judgePlus(x):
114
  try:
115
  bert_pred = BERT_predict(x)
116
  except:
117
- bert_pred = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5]
118
- #bert_pred = BERT_predict(x)
119
- #print(result)
120
 
121
  return_result = 'Result'
122
  result_lstm = np.round(lstm_pred, 2)
 
114
  try:
115
  bert_pred = BERT_predict(x)
116
  except:
117
+ bert_pred = np.average([lstm_pred, gru_pred], axis=0)
118
+
 
119
 
120
  return_result = 'Result'
121
  result_lstm = np.round(lstm_pred, 2)
phoBERT.py CHANGED
@@ -78,7 +78,6 @@ def BERT_predict(text):
78
  token_type_ids = token['token_type_ids']
79
 
80
  result = model(ids, mask, token_type_ids)
81
- print(result)
82
  # print(result)
83
  return result.tolist()[0]
84
 
 
78
  token_type_ids = token['token_type_ids']
79
 
80
  result = model(ids, mask, token_type_ids)
 
81
  # print(result)
82
  return result.tolist()[0]
83