CarlosMalaga
commited on
Commit
•
70a5d22
1
Parent(s):
baa30e5
Update app.py
Browse files
app.py
CHANGED
@@ -239,7 +239,7 @@ def run_client():
|
|
239 |
# Radio button selection
|
240 |
analysis_type = st.radio(
|
241 |
"Choose analysis type:",
|
242 |
-
options=["intervention", "outcome", "question", "db intervention", "db outcome"
|
243 |
index=2 # Default to 'question'
|
244 |
)
|
245 |
|
@@ -280,16 +280,10 @@ def run_client():
|
|
280 |
relik_model = st.session_state["relik_model"][1]
|
281 |
elif analysis_type == "outcome":
|
282 |
relik_model = st.session_state["relik_model"][2]
|
283 |
-
elif analysis_type == "db question":
|
284 |
-
relik_model = st.session_state["relik_model"][3]
|
285 |
|
286 |
elif analysis_type == "db intervention":
|
287 |
relik_model = st.session_state["relik_model"][4]
|
288 |
|
289 |
-
elif analysis_type == "db outcome":
|
290 |
-
print("hola")
|
291 |
-
relik_model = st.session_state["relik_model"][5]
|
292 |
-
|
293 |
else:
|
294 |
relik_model = st.session_state["relik_model"][0]
|
295 |
|
@@ -321,17 +315,23 @@ def run_client():
|
|
321 |
|
322 |
# heurstic, prevents split of annotation decorations
|
323 |
display = display.replace("border-radius: 0.35em;", "border-radius: 0.35em; white-space: nowrap;")
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
else:
|
336 |
st.error("Please enter some text.")
|
337 |
|
|
|
239 |
# Radio button selection
|
240 |
analysis_type = st.radio(
|
241 |
"Choose analysis type:",
|
242 |
+
options=["intervention", "outcome", "question", "db intervention", "db outcome"],
|
243 |
index=2 # Default to 'question'
|
244 |
)
|
245 |
|
|
|
280 |
relik_model = st.session_state["relik_model"][1]
|
281 |
elif analysis_type == "outcome":
|
282 |
relik_model = st.session_state["relik_model"][2]
|
|
|
|
|
283 |
|
284 |
elif analysis_type == "db intervention":
|
285 |
relik_model = st.session_state["relik_model"][4]
|
286 |
|
|
|
|
|
|
|
|
|
287 |
else:
|
288 |
relik_model = st.session_state["relik_model"][0]
|
289 |
|
|
|
315 |
|
316 |
# heurstic, prevents split of annotation decorations
|
317 |
display = display.replace("border-radius: 0.35em;", "border-radius: 0.35em; white-space: nowrap;")
|
318 |
+
|
319 |
+
with st.container():
|
320 |
+
st.write(display, unsafe_allow_html=True)
|
321 |
+
|
322 |
+
text = """
|
323 |
+
<h2 style='color: black;'>Possible Candidates:</h2>
|
324 |
+
<ul style='color: black;'>
|
325 |
+
""" + "".join(f"<li style='color: black;'>{candidate}</li>" for candidate in dict_of_ents_candidates["ents"][2:12]) + "</ul>"
|
326 |
+
|
327 |
+
st.markdown(text, unsafe_allow_html=True)
|
328 |
+
else:
|
329 |
+
text = """
|
330 |
+
<h2 style='color: black;'>Possible Candidates:</h2>
|
331 |
+
<ul style='color: black;'>
|
332 |
+
""" + "".join(f"<li style='color: black;'>{candidate}</li>" for candidate in dict_of_ents_candidates["ents"][0:10]) + "</ul>"
|
333 |
+
|
334 |
+
st.markdown(text, unsafe_allow_html=True)
|
335 |
else:
|
336 |
st.error("Please enter some text.")
|
337 |
|