atdokmeci commited on
Commit
257829e
·
verified ·
1 Parent(s): 23e750b

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +2 -2
src/streamlit_app.py CHANGED
@@ -54,7 +54,7 @@ if st.button('Predict Sentiment'):
54
  try:
55
  X = preprocess_text(text_input, preproc)
56
  prediction = model.predict(X)
57
- sentiment = 'Positive' if prediction[0][0] > 0.5 else 'Negative'
58
- st.success(f'Prediction: {sentiment} (score: {prediction[0][0]:.2f})')
59
  except Exception as e:
60
  st.error(f"Error making prediction: {e}")
 
54
  try:
55
  X = preprocess_text(text_input, preproc)
56
  prediction = model.predict(X)
57
+ sentiment = 'Positive' if prediction[0][0] < 0.5 else 'Negative'
58
+ st.success(f'Prediction: {sentiment}')
59
  except Exception as e:
60
  st.error(f"Error making prediction: {e}")