Spaces:
Running
Running
File size: 347 Bytes
47a4886 ccd2173 47a4886 a5dca46 3c65f2c 47a4886 |
1 2 3 4 5 6 7 8 |
from transformers import pipeline
summarizer = pipeline("summarization", model="EE21/BART-ToSSimplify")
def summarize_with_bart(input_text):
# Use the pipeline to generate a summary
summary = summarizer(input_text, max_length=150, min_length=40, length_penalty=2.0, num_beams=4, early_stopping=True)
return summary[0]['summary_text'] |