Update app.py
Browse files
app.py
CHANGED
@@ -59,13 +59,13 @@ if fetch_button:
|
|
59 |
article.download()
|
60 |
article.parse()
|
61 |
|
62 |
-
title =
|
63 |
-
text =
|
64 |
|
65 |
st.divider()
|
66 |
st.subheader("Real Article")
|
67 |
-
st.
|
68 |
-
st.
|
69 |
st.divider()
|
70 |
|
71 |
else:
|
@@ -101,8 +101,8 @@ if submit_button:
|
|
101 |
article.download()
|
102 |
article.parse()
|
103 |
|
104 |
-
title =
|
105 |
-
text =
|
106 |
|
107 |
# HuggingFace API request function summary
|
108 |
def query_sum(payload):
|
@@ -116,16 +116,15 @@ if submit_button:
|
|
116 |
output_sum = query_sum({"inputs": text, })
|
117 |
|
118 |
# Display the results
|
119 |
-
|
120 |
-
summary = st.text_area(summ)
|
121 |
|
122 |
st.divider()
|
123 |
st.subheader("Summary AI")
|
124 |
-
st.
|
125 |
-
st.
|
126 |
|
127 |
st.divider()
|
128 |
st.subheader("Real Article")
|
129 |
-
st.
|
130 |
-
st.
|
131 |
st.divider()
|
|
|
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.markdown(f"Your article: **{title}**")
|
68 |
+
st.markdown(f"**{text}**")
|
69 |
st.divider()
|
70 |
|
71 |
else:
|
|
|
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):
|
|
|
116 |
output_sum = query_sum({"inputs": text, })
|
117 |
|
118 |
# Display the results
|
119 |
+
summary = output_sum[0]['summary_text'].replace('<n>', " ")
|
|
|
120 |
|
121 |
st.divider()
|
122 |
st.subheader("Summary AI")
|
123 |
+
st.markdown(f"Your article: **{title}**")
|
124 |
+
st.markdown(f"**{summary}**")
|
125 |
|
126 |
st.divider()
|
127 |
st.subheader("Real Article")
|
128 |
+
st.markdown(f"Your article: **{title}**")
|
129 |
+
st.markdown(f"**{text}**")
|
130 |
st.divider()
|