Spaces:
Runtime error
Runtime error
from transformers import pipeline | |
def summarize_text(text): | |
summarizer = pipeline("summarization") | |
summary = summarizer(text, max_length=100, min_length=30, do_sample=False) | |
return summary[0]['summary_text'] | |
def main(): | |
text = input("Enter the text to be summarized: ") | |
summary = summarize_text(text) | |
print("Summary:", summary) | |
if __name__ == "__main__": | |
main() |