from transformers import pipeline | |
summarizer = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6") | |
def summarize_findings(results): | |
text = "\n".join([f"{r['url']} ({r.get('tech')})" for r in results if "url" in r]) | |
if len(text) < 100: | |
return "Not enough data to summarize." | |
return summarizer(text[:1024])[0]['summary_text'] |