ababio commited on
Commit
c60916d
1 Parent(s): bccc15c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -7
app.py CHANGED
@@ -102,16 +102,30 @@ st.write(':sunglasses: :smile: :angry: :disappointed: :fearful: :rage: :weary:
102
 
103
  # st.write("You selected:", option)
104
 
105
- option = ""
106
- village = st.checkbox("Small village")
107
- life = st.checkbox("Entire life")
108
 
109
- if village:
110
- option = "Once, in a small village nestled in the rolling hills of Tuscany, lived an elderly woman named Isabella."
111
- elif life:
 
 
 
 
 
 
 
112
  option = "Once, in a small village nestled in the rolling hills of Tuscany, lived an elderly woman named Isabella."
113
-
 
 
 
 
 
 
114
  user_input = ""
 
115
  if option:
116
  user_input = st.text_area('Enter Text to Analyze', value=option)
117
  else:
 
102
 
103
  # st.write("You selected:", option)
104
 
105
+ if "visibility" not in st.session_state:
106
+ st.session_state.visibility = "visible"
107
+ st.session_state.disabled = False
108
 
109
+ option = ""
110
+ # village = st.checkbox("Small village")
111
+ # life = st.checkbox("Entire life")
112
+ st.radio(
113
+ "Select sample texts analyse emotion 👉",
114
+ key="visibility",
115
+ options=["village", "life", "another"],
116
+ )
117
+
118
+ if st.session_state.visibility == "village":
119
  option = "Once, in a small village nestled in the rolling hills of Tuscany, lived an elderly woman named Isabella."
120
+ elif st.session_state.visibility == "life":
121
+ option = "She had spent her entire life in this village, raising her children and caring for her garden, which was the most"
122
+ elif st.session_state.visibility == "another":
123
+ option = "beautiful in the region. Her husband, Marco, had passed away many years ago, leaving her with a heart full of memories "
124
+ else:
125
+ option =""
126
+
127
  user_input = ""
128
+
129
  if option:
130
  user_input = st.text_area('Enter Text to Analyze', value=option)
131
  else: