AyoubChLin commited on
Commit
bfaeed6
·
verified ·
1 Parent(s): 99d999f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -95,7 +95,11 @@ def main():
95
  lstm_model = load_lstm_model(model_path)
96
  # Predict hate speech
97
  prediction = predict_hate_speech(input_text, lstm_model)
98
- st.success("result : " + str(prediction))
 
 
 
 
99
  #if prediction > 0.5:
100
  # st.error("Hate Speech Detected")
101
  #else:
 
95
  lstm_model = load_lstm_model(model_path)
96
  # Predict hate speech
97
  prediction = predict_hate_speech(input_text, lstm_model)
98
+ # Convert the list to a numpy array
99
+ arr = np.array(prediction[0])
100
+ max_index = np.argmax(arr)
101
+
102
+ st.success("class"+str(max_index))
103
  #if prediction > 0.5:
104
  # st.error("Hate Speech Detected")
105
  #else: