mavinsao commited on
Commit
c33cdf2
·
verified ·
1 Parent(s): 4d1b284

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -5
app.py CHANGED
@@ -20,7 +20,6 @@ def st_display_background(image_url):
20
  st.markdown(st_style, unsafe_allow_html=True)
21
 
22
  image_url = "https://images.unsplash.com/photo-1504701954957-2010ec3bcec1?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
23
- st_display_background(image_url)
24
 
25
 
26
  def ensemble_predict(text):
@@ -46,8 +45,21 @@ st.title('Mental Illness Prediction')
46
  # Input text area for user input
47
  sentence = st.text_area("Enter the long sentence to predict your mental illness state:")
48
 
 
 
49
  if st.button('Predict'):
50
- # ... (input validation ... )
51
- predicted_label, confidence = ensemble_predict(sentence)
52
- st.write("Predicted label:", predicted_label)
53
- st.write("Confidence:", confidence)
 
 
 
 
 
 
 
 
 
 
 
 
20
  st.markdown(st_style, unsafe_allow_html=True)
21
 
22
  image_url = "https://images.unsplash.com/photo-1504701954957-2010ec3bcec1?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
 
23
 
24
 
25
  def ensemble_predict(text):
 
45
  # Input text area for user input
46
  sentence = st.text_area("Enter the long sentence to predict your mental illness state:")
47
 
48
+ st_display_background(image_url)
49
+
50
  if st.button('Predict'):
51
+ # ... (input validation ... )
52
+ predicted_label, confidence = ensemble_predict(sentence)
53
+
54
+ # CSS injection to target the labels
55
+ st.markdown("""
56
+ <style>
57
+ div[data-testid="metric-container"] {
58
+ font-weight: bold;
59
+ font-size: 18px; /* Adjust the font size as desired */
60
+ }
61
+ </style>
62
+ """, unsafe_allow_html=True)
63
+
64
+ st.write("Predicted label:", predicted_label)
65
+ st.write("Confidence:", confidence)