Bayhaqy commited on
Commit
ae10a2a
·
1 Parent(s): ffaf614

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -59,13 +59,13 @@ if fetch_button:
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")
67
- st.code(f"Your article: **{title}**")
68
- st.code(f"**{text}**")
69
  st.divider()
70
 
71
  else:
@@ -101,8 +101,8 @@ if submit_button:
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,16 +116,15 @@ if submit_button:
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()
 
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()