Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ menu_items = {
|
|
20 |
'''
|
21 |
}
|
22 |
#page configuration
|
23 |
-
st.set_page_config(page_title="Article
|
24 |
st.set_option('deprecation.showPyplotGlobalUse', False)
|
25 |
|
26 |
def main():
|
@@ -32,7 +32,7 @@ def main():
|
|
32 |
"""
|
33 |
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
|
34 |
|
35 |
-
# Article
|
36 |
st.markdown("<h1 style = 'color:green; align:center; font-size: 40px;'> Article Summerizer</h1>", unsafe_allow_html=True)
|
37 |
|
38 |
# control for Model Settings
|
@@ -42,7 +42,7 @@ def main():
|
|
42 |
model_type = st.sidebar.selectbox("Model type", options=["Bart","T5"])
|
43 |
|
44 |
# This function is used to upload a .txt, .pdf, .docx file for summarization
|
45 |
-
upload_doc = st.file_uploader("Upload a .txt, .pdf, .docx file for
|
46 |
|
47 |
st.markdown("<h3 style='text-align: center; color: green;'>or</h3>",unsafe_allow_html=True)
|
48 |
|
@@ -55,7 +55,7 @@ def main():
|
|
55 |
else:
|
56 |
clean_text = preprocess_plain_text(plain_text)
|
57 |
|
58 |
-
summarize = st.button("
|
59 |
|
60 |
# called on toggle button [summarize]
|
61 |
if summarize:
|
@@ -79,7 +79,7 @@ def main():
|
|
79 |
|
80 |
res_col1 ,res_col2 = st.columns(2)
|
81 |
with res_col1:
|
82 |
-
st.subheader("Generated Text
|
83 |
# Create and generate a word cloud image:
|
84 |
wordcloud = WordCloud().generate(summarized_text)
|
85 |
# Display the generated image:
|
@@ -90,8 +90,8 @@ def main():
|
|
90 |
summary_downloader(summarized_text)
|
91 |
|
92 |
with res_col2:
|
93 |
-
st.subheader("
|
94 |
-
st.success("
|
95 |
st.write(summarized_text)
|
96 |
|
97 |
if __name__ == '__main__':
|
|
|
20 |
'''
|
21 |
}
|
22 |
#page configuration
|
23 |
+
st.set_page_config(page_title="Article Summariser", page_icon="./favicon/favicon.ico",menu_items=menu_items)
|
24 |
st.set_option('deprecation.showPyplotGlobalUse', False)
|
25 |
|
26 |
def main():
|
|
|
32 |
"""
|
33 |
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
|
34 |
|
35 |
+
# Article Summariser heading
|
36 |
st.markdown("<h1 style = 'color:green; align:center; font-size: 40px;'> Article Summerizer</h1>", unsafe_allow_html=True)
|
37 |
|
38 |
# control for Model Settings
|
|
|
42 |
model_type = st.sidebar.selectbox("Model type", options=["Bart","T5"])
|
43 |
|
44 |
# This function is used to upload a .txt, .pdf, .docx file for summarization
|
45 |
+
upload_doc = st.file_uploader("Upload a .txt, .pdf, .docx file for summarisation")
|
46 |
|
47 |
st.markdown("<h3 style='text-align: center; color: green;'>or</h3>",unsafe_allow_html=True)
|
48 |
|
|
|
55 |
else:
|
56 |
clean_text = preprocess_plain_text(plain_text)
|
57 |
|
58 |
+
summarize = st.button("Summarise")
|
59 |
|
60 |
# called on toggle button [summarize]
|
61 |
if summarize:
|
|
|
79 |
|
80 |
res_col1 ,res_col2 = st.columns(2)
|
81 |
with res_col1:
|
82 |
+
st.subheader("Generated Text Visualisation")
|
83 |
# Create and generate a word cloud image:
|
84 |
wordcloud = WordCloud().generate(summarized_text)
|
85 |
# Display the generated image:
|
|
|
90 |
summary_downloader(summarized_text)
|
91 |
|
92 |
with res_col2:
|
93 |
+
st.subheader("Summarised Text Output")
|
94 |
+
st.success("Summarised Text")
|
95 |
st.write(summarized_text)
|
96 |
|
97 |
if __name__ == '__main__':
|