Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -47,25 +47,25 @@ with st.expander("Model 1: SGD Classifier"):
|
|
47 |
|
48 |
# Text input inside the expander
|
49 |
user_input = st.text_area("Enter text here...", key='model1_input')
|
50 |
-
if st.button('Analyze', key='
|
51 |
# Displaying output
|
52 |
result = predict_sentiment(user_input, model_1)
|
53 |
if result >= 0.5:
|
54 |
-
st.write('The sentiment is: Positive π', key='
|
55 |
else:
|
56 |
-
st.write('The sentiment is: Negative π', key='
|
57 |
|
58 |
with st.expander("Model 2: CNN Sentiment analysis"):
|
59 |
st.markdown("Give it a go by writing a positive or negative text, and analyze it!")
|
60 |
|
61 |
# Text input inside the expander
|
62 |
user_input = st.text_area("Enter text here...", key='model2_input')
|
63 |
-
if st.button('Analyze', key='
|
64 |
# Displaying output
|
65 |
result = predict_sentiment(user_input, model_2)
|
66 |
if result >= 0.5:
|
67 |
-
st.write('The sentiment is: Positive π', key='
|
68 |
else:
|
69 |
-
st.write('The sentiment is: Negative π', key='
|
70 |
|
71 |
st.caption("Por @efeperro.")
|
|
|
47 |
|
48 |
# Text input inside the expander
|
49 |
user_input = st.text_area("Enter text here...", key='model1_input')
|
50 |
+
if st.button('Analyze', key='model1_button'):
|
51 |
# Displaying output
|
52 |
result = predict_sentiment(user_input, model_1)
|
53 |
if result >= 0.5:
|
54 |
+
st.write('The sentiment is: Positive π', key='model1_poswrite')
|
55 |
else:
|
56 |
+
st.write('The sentiment is: Negative π', key='model1_negwrite')
|
57 |
|
58 |
with st.expander("Model 2: CNN Sentiment analysis"):
|
59 |
st.markdown("Give it a go by writing a positive or negative text, and analyze it!")
|
60 |
|
61 |
# Text input inside the expander
|
62 |
user_input = st.text_area("Enter text here...", key='model2_input')
|
63 |
+
if st.button('Analyze', key='model2_button'):
|
64 |
# Displaying output
|
65 |
result = predict_sentiment(user_input, model_2)
|
66 |
if result >= 0.5:
|
67 |
+
st.write('The sentiment is: Positive π', key='model2_poswrite')
|
68 |
else:
|
69 |
+
st.write('The sentiment is: Negative π', key='model2_negwrite')
|
70 |
|
71 |
st.caption("Por @efeperro.")
|