suneeln-duke's picture
f
6c57304
raw
history blame
317 Bytes
from transformers import pipeline
def prep_pipeline():
summarizer = pipeline("summarization", model=f"Falconsai/text_summarization")
return summarizer
def gen_summary(summarizer, text):
summary = summarizer(text, max_length=130, min_length=30, do_sample=False)[0]["summary_text"]
return summary