Update app.py
Browse files
app.py
CHANGED
|
@@ -17,17 +17,18 @@ Barrientos, now 39, is facing two criminal counts of "offering a false instrumen
|
|
| 17 |
"""
|
| 18 |
|
| 19 |
# Create a text area for user input
|
| 20 |
-
ARTICLE = st.sidebar.text_area('Article', DEFAULT_ARTICLE, height=150)
|
| 21 |
|
| 22 |
# Define the summarization function
|
| 23 |
def summarize(txt):
|
|
|
|
| 24 |
st.write(txt[:100]) # Display the first 100 characters of the article
|
| 25 |
st.write('--------------------------------------------------------------')
|
| 26 |
summary = summarizer(txt, max_length=130, min_length=30, do_sample=False)
|
| 27 |
st.write(summary[0]['summary_text'])
|
| 28 |
|
| 29 |
# Create a button and trigger the summarize function when clicked
|
| 30 |
-
if st.sidebar.button('Summarize
|
| 31 |
summarize(ARTICLE)
|
| 32 |
else:
|
| 33 |
-
st.warning('👈 Please enter
|
|
|
|
| 17 |
"""
|
| 18 |
|
| 19 |
# Create a text area for user input
|
| 20 |
+
ARTICLE = st.sidebar.text_area('Enter Article', DEFAULT_ARTICLE, height=150)
|
| 21 |
|
| 22 |
# Define the summarization function
|
| 23 |
def summarize(txt):
|
| 24 |
+
st-write('\n\n')
|
| 25 |
st.write(txt[:100]) # Display the first 100 characters of the article
|
| 26 |
st.write('--------------------------------------------------------------')
|
| 27 |
summary = summarizer(txt, max_length=130, min_length=30, do_sample=False)
|
| 28 |
st.write(summary[0]['summary_text'])
|
| 29 |
|
| 30 |
# Create a button and trigger the summarize function when clicked
|
| 31 |
+
if st.sidebar.button('Summarize Article'):
|
| 32 |
summarize(ARTICLE)
|
| 33 |
else:
|
| 34 |
+
st.warning('👈 Please enter Article!')
|