sharath6900 commited on
Commit
cf3659c
·
verified ·
1 Parent(s): 1d5d9de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -7,11 +7,11 @@ def main():
7
  # Initialize the summarizer pipeline
8
  summarizer = pipeline(
9
  task="summarization",
10
- model="t5-small",
11
- min_length=20,
12
- max_length=40,
13
  truncation=True,
14
- )
15
 
16
  # User input
17
  input_text = st.text_area("Enter the text you want to summarize:", height=200)
@@ -20,7 +20,7 @@ def main():
20
  if st.button("Summarize"):
21
  if input_text:
22
  # Generate the summary
23
- output = summarizer(input_text, max_length=150, min_length=30, do_sample=False)
24
  summary = output[0]['summary_text']
25
 
26
  # Display the summary as bullet points
 
7
  # Initialize the summarizer pipeline
8
  summarizer = pipeline(
9
  task="summarization",
10
+ model="facebook/bart-large-cnn", # Using a different model for better summarization
11
+ min_length=50, # Increased minimum length to capture more details
12
+ max_length=150, # Adjusted max length to allow for more detailed summaries
13
  truncation=True,
14
+ )
15
 
16
  # User input
17
  input_text = st.text_area("Enter the text you want to summarize:", height=200)
 
20
  if st.button("Summarize"):
21
  if input_text:
22
  # Generate the summary
23
+ output = summarizer(input_text, max_length=150, min_length=50, do_sample=False)
24
  summary = output[0]['summary_text']
25
 
26
  # Display the summary as bullet points