Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,11 +7,11 @@ def main():
|
|
7 |
# Initialize the summarizer pipeline
|
8 |
summarizer = pipeline(
|
9 |
task="summarization",
|
10 |
-
model="
|
11 |
-
min_length=
|
12 |
-
max_length=
|
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=
|
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
|