Spaces:
Sleeping
Sleeping
Commit ·
128069b
1
Parent(s): afb77e5
Update model.py
Browse files
model.py
CHANGED
|
@@ -17,33 +17,35 @@ def run():
|
|
| 17 |
'''
|
| 18 |
This function is for running the page for predictions
|
| 19 |
'''
|
| 20 |
-
st.
|
| 21 |
-
user_input = st.text_input(
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
| 33 |
|
| 34 |
st.write('You entered:', user_input)
|
| 35 |
|
| 36 |
# button
|
| 37 |
if st.button(label='Identify Your Feelings'):
|
|
|
|
| 38 |
X= preprocess_text(user_input)
|
| 39 |
result= prediction([X])
|
| 40 |
st.write(result[1])
|
| 41 |
if result[0] == 0:
|
| 42 |
st.write("It's alright")
|
| 43 |
st.write("you'll do just fine! If ever you need help on dealing with this, EFT method could certainly help")
|
| 44 |
-
|
| 45 |
-
st.markdown(f'<a href="{url}" target="_blank">You can learn more about EFT here!</a>', unsafe_allow_html=True)
|
| 46 |
elif result[0] == 1:
|
| 47 |
-
st.write("It's alright to be angry. We believe you'll get through it eventually! If you need help calming down, we would suggest")
|
|
|
|
| 48 |
else:
|
| 49 |
st.write("That's Great! We hope the rest of the day will be as wonderful!")
|
|
|
|
| 17 |
'''
|
| 18 |
This function is for running the page for predictions
|
| 19 |
'''
|
| 20 |
+
st.subtitle("Can you describe what you're going through right now ?")
|
| 21 |
+
user_input = st.text_input(
|
| 22 |
+
value='Today, i feel...',
|
| 23 |
+
max_chars=300,
|
| 24 |
+
key='text_input_key',
|
| 25 |
+
type='default',
|
| 26 |
+
autocomplete=None,
|
| 27 |
+
on_change=None,
|
| 28 |
+
args=None,
|
| 29 |
+
kwargs=None,
|
| 30 |
+
placeholder='Please Type here...',
|
| 31 |
+
disabled=False,
|
| 32 |
+
help='Try not to think, and let your heart speak'
|
| 33 |
+
)
|
| 34 |
|
| 35 |
st.write('You entered:', user_input)
|
| 36 |
|
| 37 |
# button
|
| 38 |
if st.button(label='Identify Your Feelings'):
|
| 39 |
+
url = "https://remediindonesia.com"
|
| 40 |
X= preprocess_text(user_input)
|
| 41 |
result= prediction([X])
|
| 42 |
st.write(result[1])
|
| 43 |
if result[0] == 0:
|
| 44 |
st.write("It's alright")
|
| 45 |
st.write("you'll do just fine! If ever you need help on dealing with this, EFT method could certainly help")
|
| 46 |
+
st.markdown(f'<a href="{url}" target="_blank">You can learn more about EFT here with Rumah Remedi</a>', unsafe_allow_html=True)
|
|
|
|
| 47 |
elif result[0] == 1:
|
| 48 |
+
st.write("It's alright to be angry. We believe you'll get through it eventually! If you need help calming down, we would suggest the link below")
|
| 49 |
+
st.markdown(f'<a href="{url}" target="_blank">You could destress with Rumah Remedi</a>', unsafe_allow_html=True)
|
| 50 |
else:
|
| 51 |
st.write("That's Great! We hope the rest of the day will be as wonderful!")
|