Spaces:
Sleeping
Sleeping
File size: 318 Bytes
44db6b3 | 1 2 3 4 5 6 7 8 9 10 11 | from transformers import pipeline
summarizer = pipeline("summarization")
def summarize_object_data(data):
if len(data.strip()) > 20:
summary = summarizer(data, max_length=50, min_length=25, do_sample=False)
return summary[0]['summary_text']
else:
return "Text too short or not found"
|