Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -77,7 +77,7 @@ if (uploaded_file is not None) and (not 'generation_done' in st.session_state):
|
|
77 |
# read paper content
|
78 |
essay = monkeyReader.readEssay(saved_file_path)
|
79 |
|
80 |
-
with st.status("Understanding paper
|
81 |
|
82 |
Barttokenizer = BartTokenizer.from_pretrained('facebook/bart-large-cnn')
|
83 |
summ_model_path = 'com3dian/Bart-large-paper2slides-summarizer'
|
@@ -92,7 +92,7 @@ if (uploaded_file is not None) and (not 'generation_done' in st.session_state):
|
|
92 |
del Barttokenizer
|
93 |
length = document.merge(range_values[0],range_values[1], BartSE, device)
|
94 |
|
95 |
-
with st.status("Generating slides
|
96 |
summarizor = pipeline("summarization", model=summ_model_path, device = device)
|
97 |
title_list = document.segmentation['key']
|
98 |
summ_text = summarizor(document.segmentation['text'], max_length=100, min_length=10, do_sample=False)
|
@@ -302,4 +302,17 @@ if (summ_text is not None) or ('summ_text' in st.session_state):
|
|
302 |
file_name="slides.pdf",
|
303 |
mime="application/pdf"
|
304 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
|
|
|
77 |
# read paper content
|
78 |
essay = monkeyReader.readEssay(saved_file_path)
|
79 |
|
80 |
+
with st.status("Understanding paper...\nThis might take a while, feel free to grab a coffee!"):
|
81 |
|
82 |
Barttokenizer = BartTokenizer.from_pretrained('facebook/bart-large-cnn')
|
83 |
summ_model_path = 'com3dian/Bart-large-paper2slides-summarizer'
|
|
|
92 |
del Barttokenizer
|
93 |
length = document.merge(range_values[0],range_values[1], BartSE, device)
|
94 |
|
95 |
+
with st.status("Generating slides...\nThey'll be ready shortly!"):
|
96 |
summarizor = pipeline("summarization", model=summ_model_path, device = device)
|
97 |
title_list = document.segmentation['key']
|
98 |
summ_text = summarizor(document.segmentation['text'], max_length=100, min_length=10, do_sample=False)
|
|
|
302 |
file_name="slides.pdf",
|
303 |
mime="application/pdf"
|
304 |
)
|
305 |
+
st.markdown("""Great! Thank you for using this huggingface space.
|
306 |
+
If you want to know more about this application, you can take a look at the [paper](https://studenttheses.uu.nl/handle/20.500.12932/45939).
|
307 |
+
To contact the author you can send an email to [email protected];
|
308 |
+
To cite the paper you can use Bibtex
|
309 |
+
\n```
|
310 |
+
@mastersthesis{lu2024unsupervised,
|
311 |
+
title={Unsupervised Paper2Slides Generation},
|
312 |
+
author={Lu, Zehao},
|
313 |
+
year={2024}
|
314 |
+
}
|
315 |
+
```
|
316 |
+
To see how was the grobid's output is parsed, check [Grobidmonkey](https://github.com/com3dian/Grobidmonkey).
|
317 |
+
""")
|
318 |
|