Update app.py
Browse files
app.py
CHANGED
|
@@ -203,10 +203,11 @@ def get_and_compare_entities(article_content,summary_output):
|
|
| 203 |
|
| 204 |
all_entities_per_sentence = get_all_entities_per_sentence(article_content)
|
| 205 |
entities_article = list(itertools.chain.from_iterable(all_entities_per_sentence))
|
|
|
|
| 206 |
|
| 207 |
all_entities_per_sentence = get_all_entities_per_sentence(summary_output)
|
| 208 |
entities_summary = list(itertools.chain.from_iterable(all_entities_per_sentence))
|
| 209 |
-
|
| 210 |
matched_entities = []
|
| 211 |
unmatched_entities = []
|
| 212 |
for entity in entities_summary:
|
|
@@ -261,6 +262,8 @@ def highlight_entities(article_content,summary_output):
|
|
| 261 |
summary_output = summary_output.replace(entity, markdown_start_red + entity + markdown_end)
|
| 262 |
soup = BeautifulSoup(summary_output, features="html.parser")
|
| 263 |
print(soup)
|
|
|
|
|
|
|
| 264 |
return HTML_WRAPPER.format(soup)
|
| 265 |
|
| 266 |
|
|
|
|
| 203 |
|
| 204 |
all_entities_per_sentence = get_all_entities_per_sentence(article_content)
|
| 205 |
entities_article = list(itertools.chain.from_iterable(all_entities_per_sentence))
|
| 206 |
+
print(entities_article)
|
| 207 |
|
| 208 |
all_entities_per_sentence = get_all_entities_per_sentence(summary_output)
|
| 209 |
entities_summary = list(itertools.chain.from_iterable(all_entities_per_sentence))
|
| 210 |
+
print(entities_summary)
|
| 211 |
matched_entities = []
|
| 212 |
unmatched_entities = []
|
| 213 |
for entity in entities_summary:
|
|
|
|
| 262 |
summary_output = summary_output.replace(entity, markdown_start_red + entity + markdown_end)
|
| 263 |
soup = BeautifulSoup(summary_output, features="html.parser")
|
| 264 |
print(soup)
|
| 265 |
+
print(matched_entities)
|
| 266 |
+
print(unmatched_entities)
|
| 267 |
return HTML_WRAPPER.format(soup)
|
| 268 |
|
| 269 |
|