Update app.py
Browse files
app.py
CHANGED
@@ -33,33 +33,13 @@ import time
|
|
33 |
|
34 |
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
"
|
40 |
-
|
41 |
-
|
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=
|
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
|
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
|
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
|
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")
|