Gabriel commited on
Commit
d411c20
1 Parent(s): 8e1af49

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -14
app.py CHANGED
@@ -61,26 +61,38 @@ def generate_lexrank(in_text, threshold, model_in, ex_sent ,language, history):
61
  "Nr_sent": ex_sent,
62
  "language": language})
63
 
64
-
65
  with gr.Blocks() as demo:
66
- gr.Markdown("""# Swedish Summarization Engine!""")
67
  with gr.Accordion("Read here for details about the app", open=False):
 
68
  with gr.Tabs():
69
- with gr.TabItem("Summarization app"):
70
  gr.Markdown("""
71
- <h3>Blabla works like this.<h3>
72
- <p>lorem ipsum bl
73
- Blabla
74
- bl <p>
75
  """)
76
- with gr.TabItem("Abstractive vs Extractive"):
77
- gr.Markdown("""
78
- <h3>Abstractive vs Extractive.<h3>
79
- <p>blablaba<p>""")
80
- with gr.TabItem("Training and Data"):
81
  gr.Markdown("""
82
- <h3>Abstractive vs Extractive.<h3>
83
- <p>blablaba<p>""")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
  with gr.Tabs():
86
  with gr.TabItem("Abstractive Generation for Summarization"):
 
61
  "Nr_sent": ex_sent,
62
  "language": language})
63
 
 
64
  with gr.Blocks() as demo:
65
+ gr.Markdown("<h1><center> Swedish Summarization Engine! </center></h1>")
66
  with gr.Accordion("Read here for details about the app", open=False):
67
+
68
  with gr.Tabs():
69
+ with gr.TabItem("The Summarization App"):
70
  gr.Markdown("""
71
+ <h3>The Summarization Task</h3>
72
+ <p>
73
+ The goal of text summarization is to extract or generate concise and accurate summaries of a given text document while maintaining key information found within the original text document. Text summarization methods can either be used as an extractive or abstractive model. An Extractive method does what it sounds like, it concatenates different important sentences or paragraphs without understanding the meaning of those parts. Extractive summarization does not create any new word phrases. For instance, if you presented a page of text to an extractive model, it would just act as a text “highlighter”. However, Abstractive summarization generates text in a fashion that tries to guess the meaning in a summarised way of the page of text it is presented. It would put words together in a meaningful way and add the most important fact found in the text.
74
+ bl </p>
75
  """)
76
+
77
+ with gr.TabItem("The Summarization Engine"):
 
 
 
78
  gr.Markdown("""
79
+ <h3>Abstractive vs Extractive.</h3>
80
+ <p>
81
+ Abstractive
82
+ The underlying engines for the Abstractive part are transformer based model BART, a sequence-to-sequence model with a bidirectional (BERT-like) encoder and an autoregressive (GPT-like) decoder. The BART-model was pre-trained by KBLab/bart-base-swedish-cased (link) to learn general knowledge about language. Afterwards, the model was further fine-tuned on two labelled datasets that have been open-sourced:
83
+ Gabriel/cnn_daily_swe (link)
84
+ Gabriel/xsum_swe (link)
85
+
86
+ To see more in depth regarding the training go to link.
87
+
88
+ The core idea behind the training procedure is sequential adoption through transfer learning, i.e multiple phases for fine-tuning a pretrained model on different datasets. The figure below illustrates how the skill level of the model increases at each step:
89
+
90
+
91
+ The main benefits of transfer learning in general include the saving of resources and improved efficiency when training new models, so feel free to adopt this model for your type of problem! 🤗
92
+
93
+ Extractive:
94
+ The extractive models for this app are using sentence-transformer models, which basically is using a bi-encoder that determines how similar two sentences are. This type of models convert texts into vectors (embedding) that capture semantic information. Additionally, LexRank, an unsupervised graph-based algorithm, is used to determine centrality scores as a post-process step to summarise. The main idea is that sentences "recommend" other similar sentences to the reader. Thus, if one sentence is very similar to many others, it will likely be a sentence of great importance. The importance of this sentence also stems from the importance of the sentences "recommending" it. Thus, to get ranked highly and placed in a summary, a sentence must be similar to many sentences that are in turn also similar to many other sentences.
95
+ </p>""")
96
 
97
  with gr.Tabs():
98
  with gr.TabItem("Abstractive Generation for Summarization"):