carisackc commited on
Commit
72a0309
1 Parent(s): 07700ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -22
app.py CHANGED
@@ -103,26 +103,22 @@ runtext =st.text_area(inputNote, str(original_text2), height=300)
103
 
104
  def visualize (run_text,output):
105
  text =''
106
- best_sentences = []
107
- for sentence in output:
108
- best_sentences.append(str(sentence))
109
-
110
- # import en_core_web_sm
111
- # from spacy.lang.en import English # updated
112
- # nlp=spacy.load('en_core_web_sm')
113
- # sentences=run_text.split('.')
114
- # summary=output.split('.')
115
-
116
- text = ''
117
-
118
- #display(HTML(f'<h1>Summary - {title}</h1>'))
119
- for sentence in run_text:
120
- if sentence in best_sentences:
121
- text += ' ' + str(sentence).replace(sentence, f"<mark>{sentence}</mark>")
122
- else:
123
- text += ' ' + sentence
124
  # display(HTML(f""" {text} """))
125
-
126
 
127
 
128
  def run_model(input_text):
@@ -174,9 +170,9 @@ with col2:
174
 
175
  col3, col4 = st.columns(2)
176
  with col3:
177
- #st.text_area(visualize (runtext,output))
178
- splittext = [x for x in runtext.split('.')]
179
- st.write(splittext)
180
  with col4:
181
  st.text_area('testing', str(reference_text))#,label_visibility="hidden")
182
 
 
103
 
104
  def visualize (run_text,output):
105
  text =''
106
+ splitruntext = [x for x in runtext.split('.')]
107
+ splitoutput = [x for x in output.split('.')]
108
+ # best_sentences = []
109
+ # for sentence in output:
110
+ # best_sentences.append(str(sentence))
111
+
112
+ # text = ''
113
+
114
+ # #display(HTML(f'<h1>Summary - {title}</h1>'))
115
+ # for sentence in run_text:
116
+ # if sentence in best_sentences:
117
+ # text += ' ' + str(sentence).replace(sentence, f"<mark>{sentence}</mark>")
118
+ # else:
119
+ # text += ' ' + sentence
 
 
 
 
120
  # display(HTML(f""" {text} """))
121
+ return splitoutput,splitruntext
122
 
123
 
124
  def run_model(input_text):
 
170
 
171
  col3, col4 = st.columns(2)
172
  with col3:
173
+ st.text_area(visualize (runtext,output))
174
+
175
+ #st.write(splittext)
176
  with col4:
177
  st.text_area('testing', str(reference_text))#,label_visibility="hidden")
178