Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- 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]
|
| 58 |
-
st.success(f'Prediction: {sentiment}
|
| 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}")
|