Blaise-g commited on
Commit
9ee4991
Β·
1 Parent(s): 7c54b15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -71,7 +71,7 @@ def proc_submission(
71
  st = time.perf_counter()
72
  history = {}
73
  clean_text = clean(input_text, extra_spaces=True, lowercase=True, reg="\b(?!(?:Although|Also)\b)(?:[A-Z][A-Za-z'`-]+)(?:,? (?:(?:and |& )?(?:[A-Z][A-Za-z'`-]+)|(?:et al.?)))*(?:, *(?:19|20)[0-9][0-9](?:, p\.? [0-9]+)?| *\((?:19|20)[0-9][0-9](?:, p\.? [0-9]+)?\))", reg_replace="")
74
- max_input_length = 2048 if model_size == "tldr" else max_input_length
75
  processed = truncate_word_count(clean_text, max_input_length)
76
 
77
  if processed["was_truncated"]:
@@ -167,7 +167,7 @@ if __name__ == "__main__":
167
 
168
  gr.Markdown("# Automatic summarization of biomedical research papers with neural abstractive methods into a long and comprehensive synopsis or extreme TLDR summary version")
169
  gr.Markdown(
170
- "A demo developed for my Master Thesis project using ad-hoc fine-tuned abstractive summarization models to summarize long biomedical articles (or any scientific text related to the biomedical domain) into a detailed, explanatory synopsis or extreme TLDR summary."
171
  )
172
  with gr.Column():
173
 
@@ -185,7 +185,7 @@ if __name__ == "__main__":
185
  value=2,
186
  )
187
  gr.Markdown(
188
- "_For optimal results use a GPU as the hosted CPU inference is lacking at times and hinders the models' output summary quality._"
189
  )
190
  with gr.Row():
191
  length_penalty = gr.inputs.Slider(
@@ -211,7 +211,7 @@ if __name__ == "__main__":
211
  input_text = gr.Textbox(
212
  lines=6,
213
  label="Input Text (for summarization)",
214
- placeholder="Enter any scientific text to be condensed into a long and comprehensive digested format or an extreme TLDR summary version. The input text is divided into batches of the selected token lengths to fit within the memory constraints, pre-processed and fed into the model of choice. The models were trained to handle long scientific papers but generalize reasonably well also to shorter text documents like scientific abstracts. Might take a while to produce long summaries :)",
215
  )
216
  gr.Markdown("Upload your own file:")
217
  with gr.Row():
 
71
  st = time.perf_counter()
72
  history = {}
73
  clean_text = clean(input_text, extra_spaces=True, lowercase=True, reg="\b(?!(?:Although|Also)\b)(?:[A-Z][A-Za-z'`-]+)(?:,? (?:(?:and |& )?(?:[A-Z][A-Za-z'`-]+)|(?:et al.?)))*(?:, *(?:19|20)[0-9][0-9](?:, p\.? [0-9]+)?| *\((?:19|20)[0-9][0-9](?:, p\.? [0-9]+)?\))", reg_replace="")
74
+ #max_input_length = 2048 if model_size == "tldr" else max_input_length
75
  processed = truncate_word_count(clean_text, max_input_length)
76
 
77
  if processed["was_truncated"]:
 
167
 
168
  gr.Markdown("# Automatic summarization of biomedical research papers with neural abstractive methods into a long and comprehensive synopsis or extreme TLDR summary version")
169
  gr.Markdown(
170
+ "A demo developed for my Master Thesis project using ad-hoc fine-tuned abstractive summarization models to summarize long biomedical articles into a detailed, explanatory synopsis or extreme TLDR summary."
171
  )
172
  with gr.Column():
173
 
 
185
  value=2,
186
  )
187
  gr.Markdown(
188
+ "_For optimal results use a GPU as the hosted CPU inference is lacking at times and hinders the output summary quality as well as forcing to divide the input text into batches._"
189
  )
190
  with gr.Row():
191
  length_penalty = gr.inputs.Slider(
 
211
  input_text = gr.Textbox(
212
  lines=6,
213
  label="Input Text (for summarization)",
214
+ placeholder="Enter any scientific text to be condensed into a detailed, explanatory synopsis or TLDR summary version. The input text is divided into batches of the selected token lengths to fit within the memory constraints, pre-processed and fed into the model of choice. The models were trained to handle long scientific papers but generalize reasonably well also to shorter text documents like scientific abstracts. Might take a while to produce long summaries :)",
215
  )
216
  gr.Markdown("Upload your own file:")
217
  with gr.Row():