Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,6 @@
|
|
2 |
# coding: utf-8
|
3 |
|
4 |
# In[1]:
|
5 |
-
|
6 |
-
|
7 |
import validators, re
|
8 |
import torch
|
9 |
from fake_useragent import UserAgent
|
@@ -378,6 +376,9 @@ st.markdown("---")
|
|
378 |
|
379 |
if "text_area" not in st.session_state:
|
380 |
st.session_state.text_area = ''
|
|
|
|
|
|
|
381 |
|
382 |
url_text = st.text_input("Please Enter a url here")
|
383 |
|
@@ -418,6 +419,13 @@ article_text = st.text_area(
|
|
418 |
|
419 |
summarize = st.button("Summarize")
|
420 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
421 |
# called on toggle button [summarize]
|
422 |
if summarize:
|
423 |
if model_type == "Facebook-Bart":
|
@@ -472,7 +480,17 @@ if summarize:
|
|
472 |
# view summarized text (expander)
|
473 |
st.markdown(f"Article title: {article_title}")
|
474 |
|
475 |
-
st.markdown("####")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
st.write(entity_match_html, unsafe_allow_html=True)
|
477 |
|
478 |
st.markdown("####")
|
|
|
2 |
# coding: utf-8
|
3 |
|
4 |
# In[1]:
|
|
|
|
|
5 |
import validators, re
|
6 |
import torch
|
7 |
from fake_useragent import UserAgent
|
|
|
376 |
|
377 |
if "text_area" not in st.session_state:
|
378 |
st.session_state.text_area = ''
|
379 |
+
|
380 |
+
if "summ_area" not in st.session_state:
|
381 |
+
st.session_state.summ_area = ''
|
382 |
|
383 |
url_text = st.text_input("Please Enter a url here")
|
384 |
|
|
|
419 |
|
420 |
summarize = st.button("Summarize")
|
421 |
|
422 |
+
summarized_text = st.text_area(
|
423 |
+
label='Summarized Text with no Entity Matching',
|
424 |
+
placeholder="Full summarized text will be displayed here..",
|
425 |
+
height=250,
|
426 |
+
key='summ_area'
|
427 |
+
)
|
428 |
+
|
429 |
# called on toggle button [summarize]
|
430 |
if summarize:
|
431 |
if model_type == "Facebook-Bart":
|
|
|
480 |
# view summarized text (expander)
|
481 |
st.markdown(f"Article title: {article_title}")
|
482 |
|
483 |
+
st.markdown("####")
|
484 |
+
|
485 |
+
st.session_state.summ_area = summarized_text
|
486 |
+
|
487 |
+
summarized_text = st.text_area(
|
488 |
+
label='Summarized Text with no Entity Matching',
|
489 |
+
placeholder="Full summarized text will be displayed here..",
|
490 |
+
height=250,
|
491 |
+
key='summ_area'
|
492 |
+
)
|
493 |
+
|
494 |
st.write(entity_match_html, unsafe_allow_html=True)
|
495 |
|
496 |
st.markdown("####")
|