nickmuchi commited on
Commit
da04a86
1 Parent(s): ee00680

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -252,19 +252,22 @@ def highlight_entities(article_content,summary_output):
252
 
253
  matched_entities, unmatched_entities = get_and_compare_entities(article_content,summary_output)
254
 
255
- print(matched_entities)
256
- print(unmatched_entities)
257
- print("")
258
  print(summary_output)
259
 
260
  for entity in matched_entities:
261
  summary_output = re.sub(f'({entity})(?![^rgb\(]*\))',markdown_start_green + entity + markdown_end,summary_output)
262
 
263
  for entity in unmatched_entities:
264
- summary_output = summary_output = re.sub(f'({entity})(?![^rgb\(]*\))',markdown_start_red + entity + markdown_end,summary_output)
265
 
266
  print("")
267
  print(summary_output)
 
 
 
 
 
 
268
  soup = BeautifulSoup(summary_output, features="html.parser")
269
 
270
  return HTML_WRAPPER.format(soup)
 
252
 
253
  matched_entities, unmatched_entities = get_and_compare_entities(article_content,summary_output)
254
 
 
 
 
255
  print(summary_output)
256
 
257
  for entity in matched_entities:
258
  summary_output = re.sub(f'({entity})(?![^rgb\(]*\))',markdown_start_green + entity + markdown_end,summary_output)
259
 
260
  for entity in unmatched_entities:
261
+ summary_output = re.sub(f'({entity})(?![^rgb\(]*\))',markdown_start_red + entity + markdown_end,summary_output)
262
 
263
  print("")
264
  print(summary_output)
265
+
266
+ summary_output = summary_output.replace("/n","")
267
+
268
+ print("")
269
+ print(summary_output
270
+
271
  soup = BeautifulSoup(summary_output, features="html.parser")
272
 
273
  return HTML_WRAPPER.format(soup)