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

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'):
51
  # Displaying output
52
  result = predict_sentiment(user_input, model_1)
53
  if result >= 0.5:
54
- st.write('The sentiment is: Positive πŸ˜€')
55
  else:
56
- st.write('The sentiment is: Negative 😞')
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'):
64
  # Displaying output
65
  result = predict_sentiment(user_input, model_2)
66
  if result >= 0.5:
67
- st.write('The sentiment is: Positive πŸ˜€')
68
  else:
69
- st.write('The sentiment is: Negative 😞')
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_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.")