carisackc commited on
Commit
28a30cc
1 Parent(s): 871d472

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py CHANGED
@@ -112,6 +112,24 @@ runtext =st.text_area('Input Clinical Note here:', str(original_text2), height=3
112
 
113
  reference_text = original_text['Reference_text'].values
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
 
117
  #===== Pysummarization =====
@@ -327,4 +345,6 @@ if st.button('Submit'):
327
 
328
  st.markdown('<span style="background-color: #FFFF00">testing</span> if this **works**', unsafe_allow_html=True)
329
  st.text_area('Reference text', str(reference_text))
 
 
330
 
 
112
 
113
  reference_text = original_text['Reference_text'].values
114
 
115
+ def visualize(title, sentence_list, best_sentences):
116
+ text = ''
117
+
118
+ #display(HTML(f'<h1>Summary - {title}</h1>'))
119
+ for sentence in sentence_list:
120
+ if sentence in best_sentences:
121
+ #text += ' ' + str(sentence).replace(sentence, f"<mark>{sentence}</mark>")
122
+ text += ' ' + str(sentence).replace(sentence, f"<span class='highlight yellow'>{sentence}</span>")
123
+ else:
124
+ text += ' ' + sentence
125
+ display(HTML(f""" {text} """))
126
+
127
+ output = ''
128
+ best_sentences = []
129
+ for sentence in output:
130
+ #print(sentence)
131
+ best_sentences.append(str(sentence))
132
+ return text
133
 
134
 
135
  #===== Pysummarization =====
 
345
 
346
  st.markdown('<span style="background-color: #FFFF00">testing</span> if this **works**', unsafe_allow_html=True)
347
  st.text_area('Reference text', str(reference_text))
348
+
349
+ st.markdown(visualize(runtext,reference_text),unsafe_allow_html=True)
350