Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -221,18 +221,24 @@ with st.sidebar:
|
|
221 |
if selected_menu == "Upload Document":
|
222 |
uploaded_file = st.file_uploader("Choose a file")
|
223 |
if uploaded_file is not None:
|
224 |
-
ocr_text = get_text_from_ocr_engine(
|
225 |
st.write("Upload Successful")
|
226 |
elif selected_menu == "Extract Text":
|
227 |
st.write(get_text_from_ocr_engine())
|
228 |
elif selected_menu == "Summarize Document":
|
229 |
paragraphs= get_paragraphs_for_summaries()
|
|
|
230 |
with st.spinner("Summarizing Document..."):
|
|
|
|
|
|
|
|
|
231 |
for text in paragraphs:
|
232 |
summary_text = pipeline_summarization(text, max_length=130, min_length=30, do_sample=False)
|
233 |
# Show output
|
234 |
st.write(summary_text[0]['summary_text'])
|
235 |
st.markdown("""---""")
|
|
|
236 |
|
237 |
elif selected_menu == "Extract Entities":
|
238 |
paragraphs= get_paragraphs_for_entities()
|
@@ -243,6 +249,7 @@ elif selected_menu == "Extract Entities":
|
|
243 |
entities_text =get_formatted_text_for_annotation(output)
|
244 |
annotated_text(*entities_text)
|
245 |
st.markdown("""---""")
|
|
|
246 |
|
247 |
elif selected_menu == "Get Answers":
|
248 |
st.subheader('Question')
|
|
|
221 |
if selected_menu == "Upload Document":
|
222 |
uploaded_file = st.file_uploader("Choose a file")
|
223 |
if uploaded_file is not None:
|
224 |
+
ocr_text = get_text_from_ocr_engine()
|
225 |
st.write("Upload Successful")
|
226 |
elif selected_menu == "Extract Text":
|
227 |
st.write(get_text_from_ocr_engine())
|
228 |
elif selected_menu == "Summarize Document":
|
229 |
paragraphs= get_paragraphs_for_summaries()
|
230 |
+
|
231 |
with st.spinner("Summarizing Document..."):
|
232 |
+
tags_found = ["Injury Details", "Past Medical Conditions", "Injury Management Plan", "GP Correspondence"]
|
233 |
+
st.write("This document is about:")
|
234 |
+
st.write(";".join(["#" + tag for tag in tags_found]))
|
235 |
+
st.markdown("""---""")
|
236 |
for text in paragraphs:
|
237 |
summary_text = pipeline_summarization(text, max_length=130, min_length=30, do_sample=False)
|
238 |
# Show output
|
239 |
st.write(summary_text[0]['summary_text'])
|
240 |
st.markdown("""---""")
|
241 |
+
|
242 |
|
243 |
elif selected_menu == "Extract Entities":
|
244 |
paragraphs= get_paragraphs_for_entities()
|
|
|
249 |
entities_text =get_formatted_text_for_annotation(output)
|
250 |
annotated_text(*entities_text)
|
251 |
st.markdown("""---""")
|
252 |
+
|
253 |
|
254 |
elif selected_menu == "Get Answers":
|
255 |
st.subheader('Question')
|