ababio commited on
Commit
fdc7f47
1 Parent(s): 30991fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -10
app.py CHANGED
@@ -103,16 +103,26 @@ st.write(':sunglasses: :smile: :angry: :disappointed: :fearful: :rage: :weary:
103
  # st.write("You selected:", option)
104
 
105
 
106
- option = ""
107
  user_input = ""
108
 
109
- st.write("Select sample texts analyse emotion 👉")
110
- village = st.checkbox("Small village")
111
- life = st.checkbox("Entire life")
112
 
 
 
 
 
 
 
 
 
 
113
 
114
- if village:
115
- option = """Getting late for a meeting, need to run’, he said, as he slung his coat over the shoulder, and bounded out of the house. As he drove away, she came running down the stairs two at a time. ‘Wait, wait’, she said, but he had already left.
 
116
  Her mouth crumpled like used wrapping paper. ‘He forgot to give me a goodbye kiss’, she whispered in a voice that trembled under the weight of her hurt. She called him, ‘you left without giving me a kiss’, she said accusingly. ‘I am sorry sweetheart’, he said, his voice contrite. ‘It is okay’, she said, trying to be all grown up as she cut the call.
117
  She gulped down her breakfast morosely, wore her shoes, picked up her school bag and started to walk out of the door, her shoulders slumped. As she climbed down the steps, the car glided to a stop outside the house. He got out of the car. She ran to him, her whole face lit up like a Christmas tree.
118
  ‘I am sorry I forgot’, he said, as he picked her up and hugged her. She said nothing. Her jaw ached from smiling.
@@ -146,8 +156,8 @@ At that moment, a drunk driver was speeding down that very same street. He sever
146
  Miraculously, the girl survived. Remembering the note later, she unfolded it and read,
147
 
148
  ‘Without your love, I would die.’"""
149
- elif life:
150
- option = """I consider myself an observant. I often spend time being quiet, just staring and watching my surroundings, from the main situation to things that most people don’t notice, like that single fly who broke its wings and is currently struggling to turn its body over; like the dust piling in the corner of my bus’ automatic door.
151
 
152
  During my bus ride home, I usually listen to some music from my Spotify (give it a follow if you want to) and just stare out the window, watching the city at night, admiring all its mesmerizing skyscrapers and the dim street lights.
153
 
@@ -167,11 +177,11 @@ There are still so many other dreams that came true. More and more are coming tr
167
 
168
  Apparently life is not as boring if we appreciate the smallest things."""
169
  else:
170
- option =""
171
 
172
 
173
  if option:
174
- user_input = st.text_area('Enter Text to Analyze', value=option)
175
  else:
176
  user_input = st.text_area('Enter Text to Analyze')
177
 
 
103
  # st.write("You selected:", option)
104
 
105
 
106
+ optionValue = ""
107
  user_input = ""
108
 
109
+ # st.write("Select sample texts analyse emotion 👉")
110
+ # village = st.checkbox("Sample 1")
111
+ # life = st.checkbox("Sample 2")
112
 
113
+ option = st.selectbox(
114
+ "Select sample texts analyse emotion 👉",
115
+ (
116
+ "Sample 1: Getting late for a meeting",
117
+ "Sample 2: I consider myself an observant"
118
+ ),
119
+ index=None,
120
+ placeholder="Select contact method...",
121
+ )
122
 
123
+
124
+ if option == "Sample 1: Getting late for a meeting":
125
+ optionValue = """Getting late for a meeting, need to run’, he said, as he slung his coat over the shoulder, and bounded out of the house. As he drove away, she came running down the stairs two at a time. ‘Wait, wait’, she said, but he had already left.
126
  Her mouth crumpled like used wrapping paper. ‘He forgot to give me a goodbye kiss’, she whispered in a voice that trembled under the weight of her hurt. She called him, ‘you left without giving me a kiss’, she said accusingly. ‘I am sorry sweetheart’, he said, his voice contrite. ‘It is okay’, she said, trying to be all grown up as she cut the call.
127
  She gulped down her breakfast morosely, wore her shoes, picked up her school bag and started to walk out of the door, her shoulders slumped. As she climbed down the steps, the car glided to a stop outside the house. He got out of the car. She ran to him, her whole face lit up like a Christmas tree.
128
  ‘I am sorry I forgot’, he said, as he picked her up and hugged her. She said nothing. Her jaw ached from smiling.
 
156
  Miraculously, the girl survived. Remembering the note later, she unfolded it and read,
157
 
158
  ‘Without your love, I would die.’"""
159
+ elif option == "Sample 2: I consider myself an observant":
160
+ optionValue = """I consider myself an observant. I often spend time being quiet, just staring and watching my surroundings, from the main situation to things that most people don’t notice, like that single fly who broke its wings and is currently struggling to turn its body over; like the dust piling in the corner of my bus’ automatic door.
161
 
162
  During my bus ride home, I usually listen to some music from my Spotify (give it a follow if you want to) and just stare out the window, watching the city at night, admiring all its mesmerizing skyscrapers and the dim street lights.
163
 
 
177
 
178
  Apparently life is not as boring if we appreciate the smallest things."""
179
  else:
180
+ optionValue =""
181
 
182
 
183
  if option:
184
+ user_input = st.text_area('Enter Text to Analyze', value=optionValue)
185
  else:
186
  user_input = st.text_area('Enter Text to Analyze')
187