Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -215,7 +215,7 @@ Dr Jason Sanders"""
|
|
215 |
|
216 |
with st.sidebar:
|
217 |
selected_menu = option_menu("Select Option",
|
218 |
-
["Upload Document", "Extract Text", "Summarize Document", "Extract Entities","Get Answers"],
|
219 |
menu_icon="cast", default_index=0)
|
220 |
|
221 |
|
@@ -259,7 +259,23 @@ elif selected_menu == "Extract Entities":
|
|
259 |
entities_text =get_formatted_text_for_annotation(output)
|
260 |
annotated_text(*entities_text)
|
261 |
st.markdown("""---""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
|
|
|
|
|
|
|
|
|
|
|
263 |
|
264 |
elif selected_menu == "Get Answers":
|
265 |
st.subheader('Question')
|
|
|
215 |
|
216 |
with st.sidebar:
|
217 |
selected_menu = option_menu("Select Option",
|
218 |
+
["Upload Document", "Extract Text", "Summarize Document", "Extract Entities","Detected Barriers","Get Answers"],
|
219 |
menu_icon="cast", default_index=0)
|
220 |
|
221 |
|
|
|
259 |
entities_text =get_formatted_text_for_annotation(output)
|
260 |
annotated_text(*entities_text)
|
261 |
st.markdown("""---""")
|
262 |
+
|
263 |
+
elif selected_menu == "Detected Barriers":
|
264 |
+
st.subheader('Barriers Detected')
|
265 |
+
barriers_to_detect = {"Chronic Pain":"Is the patint experiencing chronic pain?",
|
266 |
+
,"Mental Health Issues":"Does he have any mental issues?",
|
267 |
+
"Prior History":"What is prior medical history?",
|
268 |
+
"Smoking":"Does he smoke?",
|
269 |
+
"Drinking":"Does he drink?",
|
270 |
+
"Comorbidities":"Does he have any comorbidities?"]
|
271 |
+
|
272 |
+
for barrier,question_text from barriers_to_detect.items():
|
273 |
|
274 |
+
context = get_text_from_ocr_engine()
|
275 |
+
if question_text:
|
276 |
+
result = pipeline_qa(question=question_text, context=context)
|
277 |
+
st.subheader(barrier)
|
278 |
+
st.text(result['answer'])
|
279 |
|
280 |
elif selected_menu == "Get Answers":
|
281 |
st.subheader('Question')
|