Spaces:
Sleeping
Sleeping
ashishkgpian
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ custom_css = """
|
|
29 |
background-color: #f0f4f7 !important;
|
30 |
}
|
31 |
|
32 |
-
|
33 |
text-align: center;
|
34 |
padding: 1rem;
|
35 |
margin-bottom: 2rem;
|
@@ -38,16 +38,16 @@ custom_css = """
|
|
38 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
39 |
}
|
40 |
|
41 |
-
|
42 |
-
color: #2c3e50;
|
43 |
-
font-size: 2.5rem;
|
44 |
-
margin-bottom: 0.5rem;
|
45 |
}
|
46 |
|
47 |
-
|
48 |
-
color: #34495e;
|
49 |
-
font-size: 1.2rem;
|
50 |
-
font-weight: normal;
|
51 |
}
|
52 |
|
53 |
.input-container {
|
@@ -58,7 +58,7 @@ custom_css = """
|
|
58 |
margin-bottom: 1.5rem !important;
|
59 |
}
|
60 |
|
61 |
-
|
62 |
border: 2px solid #3498db !important;
|
63 |
border-radius: 8px !important;
|
64 |
padding: 1rem !important;
|
@@ -81,15 +81,6 @@ custom_css = """
|
|
81 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
|
82 |
}
|
83 |
|
84 |
-
.example-text {
|
85 |
-
font-size: 0.9rem !important;
|
86 |
-
color: #2c3e50 !important;
|
87 |
-
padding: 0.5rem !important;
|
88 |
-
border-radius: 4px !important;
|
89 |
-
background: #f8f9fa !important;
|
90 |
-
margin: 0.5rem 0 !important;
|
91 |
-
}
|
92 |
-
|
93 |
.footer {
|
94 |
text-align: center;
|
95 |
margin-top: 2rem;
|
@@ -98,53 +89,41 @@ custom_css = """
|
|
98 |
border-radius: 10px;
|
99 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
100 |
}
|
101 |
-
|
102 |
-
.label {
|
103 |
-
font-size: 1.2rem !important;
|
104 |
-
color: #2c3e50 !important;
|
105 |
-
font-weight: 600 !important;
|
106 |
-
margin-bottom: 0.5rem !important;
|
107 |
-
}
|
108 |
"""
|
109 |
|
110 |
with gr.Blocks(css=custom_css) as demo:
|
111 |
-
with gr.Row():
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
)
|
119 |
|
120 |
with gr.Row():
|
121 |
with gr.Column(elem_classes=["input-container"]):
|
122 |
input_text = gr.Textbox(
|
123 |
label="Clinical Symptom Description",
|
124 |
placeholder="Enter detailed patient symptoms and clinical observations...",
|
125 |
-
lines=5
|
126 |
-
elem_classes=["textbox"]
|
127 |
)
|
128 |
|
129 |
-
with gr.Row():
|
130 |
output = gr.JSON(
|
131 |
-
label="Suggested ICD9 Diagnostic Codes"
|
132 |
-
elem_classes=["output-container"]
|
133 |
)
|
134 |
|
135 |
-
with gr.Row():
|
136 |
-
|
137 |
-
examples
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
elem_classes=["example-text"]
|
147 |
-
)
|
148 |
|
149 |
input_text.submit(fn=classify_symptoms, inputs=input_text, outputs=output)
|
150 |
|
|
|
29 |
background-color: #f0f4f7 !important;
|
30 |
}
|
31 |
|
32 |
+
.main-container {
|
33 |
text-align: center;
|
34 |
padding: 1rem;
|
35 |
margin-bottom: 2rem;
|
|
|
38 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
39 |
}
|
40 |
|
41 |
+
h1 {
|
42 |
+
color: #2c3e50 !important;
|
43 |
+
font-size: 2.5rem !important;
|
44 |
+
margin-bottom: 0.5rem !important;
|
45 |
}
|
46 |
|
47 |
+
h3 {
|
48 |
+
color: #34495e !important;
|
49 |
+
font-size: 1.2rem !important;
|
50 |
+
font-weight: normal !important;
|
51 |
}
|
52 |
|
53 |
.input-container {
|
|
|
58 |
margin-bottom: 1.5rem !important;
|
59 |
}
|
60 |
|
61 |
+
textarea {
|
62 |
border: 2px solid #3498db !important;
|
63 |
border-radius: 8px !important;
|
64 |
padding: 1rem !important;
|
|
|
81 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
|
82 |
}
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
.footer {
|
85 |
text-align: center;
|
86 |
margin-top: 2rem;
|
|
|
89 |
border-radius: 10px;
|
90 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
91 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
"""
|
93 |
|
94 |
with gr.Blocks(css=custom_css) as demo:
|
95 |
+
with gr.Row(elem_classes=["main-container"]):
|
96 |
+
gr.Markdown(
|
97 |
+
"""
|
98 |
+
# 🏥 MedAI: Clinical Symptom ICD9 Classifier
|
99 |
+
### Advanced AI-Powered Diagnostic Code Assistant
|
100 |
+
"""
|
101 |
+
)
|
|
|
102 |
|
103 |
with gr.Row():
|
104 |
with gr.Column(elem_classes=["input-container"]):
|
105 |
input_text = gr.Textbox(
|
106 |
label="Clinical Symptom Description",
|
107 |
placeholder="Enter detailed patient symptoms and clinical observations...",
|
108 |
+
lines=5
|
|
|
109 |
)
|
110 |
|
111 |
+
with gr.Row(elem_classes=["output-container"]):
|
112 |
output = gr.JSON(
|
113 |
+
label="Suggested ICD9 Diagnostic Codes"
|
|
|
114 |
)
|
115 |
|
116 |
+
with gr.Row(elem_classes=["examples-container"]):
|
117 |
+
examples = gr.Examples(
|
118 |
+
examples=[
|
119 |
+
["45-year-old male experiencing severe chest pain, radiating to left arm, with shortness of breath and excessive sweating"],
|
120 |
+
["Persistent headache for 2 weeks, accompanied by dizziness and occasional blurred vision"],
|
121 |
+
["Diabetic patient reporting frequent urination, increased thirst, and unexplained weight loss"],
|
122 |
+
["Elderly patient with chronic knee pain, reduced mobility, and signs of inflammation"]
|
123 |
+
],
|
124 |
+
inputs=input_text,
|
125 |
+
label="Example Clinical Cases"
|
126 |
+
)
|
|
|
|
|
127 |
|
128 |
input_text.submit(fn=classify_symptoms, inputs=input_text, outputs=output)
|
129 |
|