Questo / summerizer_service /summarize_text.py
shubhendu-ghosh-DS
change model
e5924b8
raw
history blame
340 Bytes
from transformers import pipeline
class Summarizer:
def __init__(self):
pass
def summarize_text(self, text):
summarizer = pipeline("summarization", model="Falconsai/text_summarization")
summary = summarizer(text, max_length=500, min_length=100, do_sample=False)
return summary[0]['summary_text']