efeperro commited on
Commit
9bd634e
β€’
1 Parent(s): c5090f9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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='model1_input'):
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_input')
55
  else:
56
- st.write('The sentiment is: Negative 😞', key='model1_input')
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_input'):
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_input')
68
  else:
69
- st.write('The sentiment is: Negative 😞', key='model2_input')
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.")