Update app.py
Browse files
app.py
CHANGED
@@ -54,6 +54,19 @@ if fetch_button:
|
|
54 |
with st.spinner('Fetching your article...'):
|
55 |
time.sleep(3)
|
56 |
st.success('Your article is ready for summarization!')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
else:
|
59 |
st.write("Error occurred while fetching article.")
|
@@ -87,10 +100,9 @@ if submit_button:
|
|
87 |
article = Article(url)
|
88 |
article.download()
|
89 |
article.parse()
|
90 |
-
|
91 |
title = article.title
|
92 |
text = article.text
|
93 |
-
summary_lib = article.summary
|
94 |
|
95 |
# HuggingFace API request function summary
|
96 |
def query_sum(payload):
|
@@ -109,9 +121,4 @@ if submit_button:
|
|
109 |
st.divider()
|
110 |
st.subheader("Summary AI")
|
111 |
st.write(f"Your article: **{title}**")
|
112 |
-
st.write(f"**{summary}**")
|
113 |
-
|
114 |
-
st.divider()
|
115 |
-
st.subheader("Real Article")
|
116 |
-
st.write(f"Your article: **{title}**")
|
117 |
-
st.write(f"**{text}**")
|
|
|
54 |
with st.spinner('Fetching your article...'):
|
55 |
time.sleep(3)
|
56 |
st.success('Your article is ready for summarization!')
|
57 |
+
|
58 |
+
article = Article(url)
|
59 |
+
article.download()
|
60 |
+
article.parse()
|
61 |
+
|
62 |
+
title = article.title
|
63 |
+
text = article.text
|
64 |
+
|
65 |
+
st.divider()
|
66 |
+
st.subheader("Real Article")
|
67 |
+
st.write(f"Your article: **{title}**")
|
68 |
+
st.write(f"**{text}**")
|
69 |
+
st.divider()
|
70 |
|
71 |
else:
|
72 |
st.write("Error occurred while fetching article.")
|
|
|
100 |
article = Article(url)
|
101 |
article.download()
|
102 |
article.parse()
|
103 |
+
|
104 |
title = article.title
|
105 |
text = article.text
|
|
|
106 |
|
107 |
# HuggingFace API request function summary
|
108 |
def query_sum(payload):
|
|
|
121 |
st.divider()
|
122 |
st.subheader("Summary AI")
|
123 |
st.write(f"Your article: **{title}**")
|
124 |
+
st.write(f"**{summary}**")
|
|
|
|
|
|
|
|
|
|