Minor text changes
Browse files
app.py
CHANGED
@@ -307,29 +307,29 @@ st.title('π Summarization fact checker π')
|
|
307 |
st.header("π§βπ« Introduction")
|
308 |
|
309 |
introduction_checkbox = st.checkbox("Show introduction text", value=True)
|
310 |
-
if introduction_checkbox:
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
|
334 |
# GENERATING SUMMARIES PART
|
335 |
st.header("πͺΆ Generating summaries")
|
@@ -356,7 +356,7 @@ if summarize_button:
|
|
356 |
st.markdown("####")
|
357 |
st.markdown(
|
358 |
"*Below you can find the generated summary for the article. We will discuss two approaches that we found are "
|
359 |
-
"able to detect some common errors. Based on errors, one could then score different summaries, indicating how "
|
360 |
"factual a summary is for a given article. The idea is that in production, you could generate a set of "
|
361 |
"summaries for the same article, with different parameters (or even different models). By using "
|
362 |
"post-processing error detection, we can then select the best possible summary.*")
|
@@ -394,7 +394,7 @@ if summarize_button:
|
|
394 |
"should also be present in the article. Thus we can extract all entities from the summary and compare "
|
395 |
"them to the entities of the original article, spotting potential hallucinations. The more unmatched "
|
396 |
"entities we find, the lower the factualness score of the summary. ")
|
397 |
-
with st.spinner("Calculating and matching entities..."):
|
398 |
entity_match_html = highlight_entities()
|
399 |
st.markdown("####")
|
400 |
st.write(entity_match_html, unsafe_allow_html=True)
|
@@ -485,7 +485,7 @@ if summarize_button:
|
|
485 |
"will hopefully be at the top. Summaries with the same scores will get the same rank displayed.")
|
486 |
st.markdown("####")
|
487 |
|
488 |
-
with st.spinner("Calculating more summaries and scoring them, this might take
|
489 |
summaries_list = []
|
490 |
deduction_points = []
|
491 |
# ENTITIES
|
|
|
307 |
st.header("π§βπ« Introduction")
|
308 |
|
309 |
introduction_checkbox = st.checkbox("Show introduction text", value=True)
|
310 |
+
#if introduction_checkbox:
|
311 |
+
st.markdown("""
|
312 |
+
Recent work using π€ **transformers** π€ on large text corpora has shown great success when fine-tuned on
|
313 |
+
several different downstream NLP tasks. One such task is that of text summarization. The goal of text summarization
|
314 |
+
is to generate concise and accurate summaries from input document(s). There are 2 types of summarization:
|
315 |
+
|
316 |
+
- **Extractive summarization** merely copies informative fragments from the input
|
317 |
+
- **Abstractive summarization** may generate novel words. A good abstractive summary should cover principal
|
318 |
+
information in the input and has to be linguistically fluent. This interactive blogpost will focus on this more difficult task of
|
319 |
+
abstractive summary generation. Furthermore we will focus on factual errors in summaries, and less sentence fluency.""")
|
320 |
+
|
321 |
+
st.markdown("###")
|
322 |
+
st.markdown("π€ **Why is this important?** π€ Let's say we want to summarize news articles for a popular "
|
323 |
+
"newspaper. If an article tells the story of Elon Musk buying **Twitter**, we don't want our summarization "
|
324 |
+
"model to say that he bought **Facebook** instead. Summarization could also be done for financial reports "
|
325 |
+
"for example. In such environments, these errors can be very critical, so we want to find a way to "
|
326 |
+
"detect them.")
|
327 |
+
st.markdown("###")
|
328 |
+
st.markdown("""To generate summaries we will use the π [PEGASUS](https://huggingface.co/google/pegasus-cnn_dailymail) π
|
329 |
+
model, producing abstractive summaries from large articles. These summaries often contain sentences with different
|
330 |
+
kinds of errors. Rather than improving the core model, we will look into possible post-processing steps to detect errors
|
331 |
+
from the generated summaries. Throughout this blog, we will also explain the results for some methods on specific
|
332 |
+
examples. These text blocks will be indicated and they change according to the currently selected article.""")
|
333 |
|
334 |
# GENERATING SUMMARIES PART
|
335 |
st.header("πͺΆ Generating summaries")
|
|
|
356 |
st.markdown("####")
|
357 |
st.markdown(
|
358 |
"*Below you can find the generated summary for the article. We will discuss two approaches that we found are "
|
359 |
+
"able to detect some common errors. Based on these errors, one could then score different summaries, indicating how "
|
360 |
"factual a summary is for a given article. The idea is that in production, you could generate a set of "
|
361 |
"summaries for the same article, with different parameters (or even different models). By using "
|
362 |
"post-processing error detection, we can then select the best possible summary.*")
|
|
|
394 |
"should also be present in the article. Thus we can extract all entities from the summary and compare "
|
395 |
"them to the entities of the original article, spotting potential hallucinations. The more unmatched "
|
396 |
"entities we find, the lower the factualness score of the summary. ")
|
397 |
+
with st.spinner("Calculating and matching entities, this takes about 10-20 seconds..."):
|
398 |
entity_match_html = highlight_entities()
|
399 |
st.markdown("####")
|
400 |
st.write(entity_match_html, unsafe_allow_html=True)
|
|
|
485 |
"will hopefully be at the top. Summaries with the same scores will get the same rank displayed.")
|
486 |
st.markdown("####")
|
487 |
|
488 |
+
with st.spinner("Calculating more summaries and scoring them, this might take a minute or two..."):
|
489 |
summaries_list = []
|
490 |
deduction_points = []
|
491 |
# ENTITIES
|