Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -74,8 +74,8 @@ title = "Welcome to **ADR Tracker**"
|
|
74 |
description1 = "This app takes text (up to a few sentences) and predicts to what extent the text describes severe (or non-severe) adverse reaction to medications. Please do NOT use for medical diagnosis."
|
75 |
|
76 |
css = """
|
77 |
-
body { font-family: 'Roboto', sans-serif; background-color: #333; color: #
|
78 |
-
h1, h2, h3, h4, h5, h6, p, label, .markdown { color: #
|
79 |
.textbox { width: 100%; border-radius: 10px; border: 1px solid #ccc; background-color: white; color: black; }
|
80 |
.button { background-color: #FF6347; color: white; border: none; border-radius: 10px; padding: 10px 20px; cursor: pointer; }
|
81 |
"""
|
@@ -101,10 +101,18 @@ with gr.Blocks(css=css) as demo:
|
|
101 |
api_name="adr"
|
102 |
)
|
103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
with gr.Row():
|
105 |
gr.Markdown("### Click on any of the examples below to see how it works:")
|
106 |
gr.Examples([["A 35 year-old male had severe headache after taking Aspirin. The lab results were normal."],
|
107 |
["A 35 year-old female had minor pain in upper abdomen after taking Acetaminophen."]],
|
108 |
[prob1], [label, local_plot, htext], main, cache_examples=True)
|
109 |
-
|
110 |
-
demo.launch()
|
|
|
74 |
description1 = "This app takes text (up to a few sentences) and predicts to what extent the text describes severe (or non-severe) adverse reaction to medications. Please do NOT use for medical diagnosis."
|
75 |
|
76 |
css = """
|
77 |
+
body { font-family: 'Roboto', sans-serif; background-color: #333; color: #163E64; }
|
78 |
+
h1, h2, h3, h4, h5, h6, p, label, .markdown { color: #163E64; } /* Ensuring that all text elements are consistently light blue */
|
79 |
.textbox { width: 100%; border-radius: 10px; border: 1px solid #ccc; background-color: white; color: black; }
|
80 |
.button { background-color: #FF6347; color: white; border: none; border-radius: 10px; padding: 10px 20px; cursor: pointer; }
|
81 |
"""
|
|
|
101 |
api_name="adr"
|
102 |
)
|
103 |
|
104 |
+
gr.Markdown("### Legend")
|
105 |
+
legend = gr.HTML(value="<div style='margin-top: 20px;'><strong>Legend:</strong><br>" +
|
106 |
+
"<mark style='background-color:#E63946;'>Severity</mark> " +
|
107 |
+
"<mark style='background-color:#2A9D8F;'>Sign/Symptom</mark> " +
|
108 |
+
"<mark style='background-color:#457B9D;'>Medication</mark> " +
|
109 |
+
"<mark style='background-color:#F4A261;'>Age/Sex</mark> " +
|
110 |
+
"<mark style='background-color:#9C6644;'>Diagnostic Procedure</mark> " +
|
111 |
+
"<mark style='background-color:#BDB2FF;'>Biological Structure</mark></div>")
|
112 |
+
gr.Row([legend])
|
113 |
+
|
114 |
with gr.Row():
|
115 |
gr.Markdown("### Click on any of the examples below to see how it works:")
|
116 |
gr.Examples([["A 35 year-old male had severe headache after taking Aspirin. The lab results were normal."],
|
117 |
["A 35 year-old female had minor pain in upper abdomen after taking Acetaminophen."]],
|
118 |
[prob1], [label, local_plot, htext], main, cache_examples=True)
|
|
|
|