joaopimenta commited on
Commit
35d73c6
Β·
verified Β·
1 Parent(s): 354c252

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -31
app.py CHANGED
@@ -33,33 +33,13 @@ import time
33
 
34
 
35
 
36
- pages = ["Home", "Tabular data", "Clinical text notes", "Ensemble prediction"]
37
-
38
- styles = {
39
- "nav": {
40
- "background-color": "rgba(0, 0, 0, 0.5)",
41
- # Add 50% transparency
42
- },
43
- "div": {
44
- "max-width": "32rem",
45
- },
46
- "span": {
47
- "border-radius": "0.26rem",
48
- "color": "rgb(255 ,255, 255)",
49
- "margin": "0 0.225rem",
50
- "padding": "0.375rem 0.625rem",
51
- },
52
- "active": {
53
- "background-color": "rgba(0 ,0, 200, 0.95)",
54
- },
55
- "hover": {
56
- "background-color": "rgba(255, 255, 255, 0.95)",
57
- },
58
- }
59
-
60
- page = st_navbar(pages, styles=styles)
61
-
62
- if page=="Home":
63
 
64
  st.markdown("""
65
  <style>
@@ -92,7 +72,7 @@ if page=="Home":
92
  image_2 = 'https://med-tech.world/app/uploads/2024/10/AI-Hospitals.jpg.webp'
93
 
94
 
95
- st.image(image_2, width=1350) # Hospital Icon
96
 
97
  st.write("This app helps predict patient readmission risk using machine learning models. "
98
  "Upload data, analyze clinical notes, and see predictions from our ensemble model.")
@@ -101,7 +81,7 @@ if page=="Home":
101
  st.markdown("---")
102
  st.markdown("<h3 style='text-align: center;'>πŸš€ Explore the App</h3>", unsafe_allow_html=True)
103
 
104
- elif page== "Tabular data":
105
 
106
  # Function to load Lottie animation
107
  def load_lottie(url):
@@ -415,7 +395,7 @@ elif page== "Tabular data":
415
  # βœ… Render SHAP force plot in Streamlit
416
  components.html(shap_html, height=400)
417
 
418
- elif page == "Clinical text notes":
419
  # Set Streamlit Page Title
420
  st.subheader("πŸ“ Clinical Text Note")
421
 
@@ -781,7 +761,7 @@ elif page == "Clinical text notes":
781
  </div>
782
  """, unsafe_allow_html=True)
783
 
784
- elif page == "Ensemble prediction":
785
 
786
  # Load the ensemble model
787
  ensemble_model = joblib.load("/Users/joaopimenta/Downloads/best_ensemble_model.pkl")
 
33
 
34
 
35
 
36
+ # Criar o menu na barra lateral
37
+ st.sidebar.title("πŸ“Œ Menu")
38
+ page = st.sidebar.radio(
39
+ "Selecione uma opção:",
40
+ ["🏠 Home", "πŸ“Š Tabular Data", "πŸ“ Clinical Text Notes", "πŸ”€ Ensemble Prediction"]
41
+ )
42
+ if page=="🏠 Home":
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
  st.markdown("""
45
  <style>
 
72
  image_2 = 'https://med-tech.world/app/uploads/2024/10/AI-Hospitals.jpg.webp'
73
 
74
 
75
+ st.image(image_2, width=1450) # Hospital Icon
76
 
77
  st.write("This app helps predict patient readmission risk using machine learning models. "
78
  "Upload data, analyze clinical notes, and see predictions from our ensemble model.")
 
81
  st.markdown("---")
82
  st.markdown("<h3 style='text-align: center;'>πŸš€ Explore the App</h3>", unsafe_allow_html=True)
83
 
84
+ elif page== "πŸ“Š Tabular Data":
85
 
86
  # Function to load Lottie animation
87
  def load_lottie(url):
 
395
  # βœ… Render SHAP force plot in Streamlit
396
  components.html(shap_html, height=400)
397
 
398
+ elif page == "πŸ“ Clinical Text Notes":
399
  # Set Streamlit Page Title
400
  st.subheader("πŸ“ Clinical Text Note")
401
 
 
761
  </div>
762
  """, unsafe_allow_html=True)
763
 
764
+ elif page == "πŸ”€ Ensemble Prediction":
765
 
766
  # Load the ensemble model
767
  ensemble_model = joblib.load("/Users/joaopimenta/Downloads/best_ensemble_model.pkl")