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