Loading…
Glossary term
Condensing a longer text into a shorter version that keeps the key points.
Summarization shortens a text while keeping its key points. Extractive methods pick important sentences; abstractive methods, used by language models, write new sentences.
The risk is that a summary adds, drops or distorts details, so checking against the source matters.
Summarize with a pipeline
from transformers import pipeline
summarize = pipeline("summarization")
print(summarize(long_text, max_length=60, min_length=20)[0]["summary_text"])It saves reading time on long documents, meetings and news.