hardik90 commited on
Commit
86398a2
·
verified ·
1 Parent(s): 4f476af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -9
app.py CHANGED
@@ -7,16 +7,19 @@ summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
7
  # Streamlit App
8
  st.title("Summarization App")
9
 
10
- # Input text area
11
- article = st.text_area("Enter the article:", ARTICLE, height=300)
12
 
13
  if st.button("Generate Summary"):
14
- # Generate summary using the summarizer pipeline
15
- summary_result = summarizer(article, max_length=130, min_length=30, do_sample=False)
 
16
 
17
- # Extract the summary text
18
- summary_text = summary_result[0]['summary_text']
19
 
20
- # Display the summary
21
- st.subheader("Summary:")
22
- st.write(summary_text)
 
 
 
7
  # Streamlit App
8
  st.title("Summarization App")
9
 
10
+ # Input text area for user to enter the article
11
+ article = st.text_area("Enter the article:", "", height=300)
12
 
13
  if st.button("Generate Summary"):
14
+ if article:
15
+ # Generate summary using the summarizer pipeline
16
+ summary_result = summarizer(article, max_length=130, min_length=30, do_sample=False)
17
 
18
+ # Extract the summary text
19
+ summary_text = summary_result[0]['summary_text']
20
 
21
+ # Display the summary
22
+ st.subheader("Summary:")
23
+ st.write(summary_text)
24
+ else:
25
+ st.warning("Please enter an article for summarization.")