Spaces:
Sleeping
Sleeping
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'] |