Text Summarization
Summarization compresses a document to its essential meaning, by either selecting sentences to keep (extractive) or writing new ones (abstractive). This part fixes the task and its flavors — single vs.
╌╌╌╌
Text summarization is the task of taking a full-length document and producing a shorter text that keeps its most important information. Stated as a mapping it is the same shape as translation — a source goes in and a shorter target with comes out — but where translation preserves meaning across a change of language, summarization preserves the essential meaning across a change of length. The modern method is context-based autoregressive generation: prime a language model with the document and let it generate the summary, exactly the sequence-to-sequence recipe translation established.1 This lesson covers what the task is, the two families of methods that solve it, and how to tell whether a summary is any good.
The task and its flavors
Summarize this
is really a family of tasks that differ along a few axes.
Identifying which variant applies comes first, because it determines both the
method and the evaluation.
Single- vs. multi-document. A single-document summarizer condenses one article. A multi-document summarizer fuses many sources on the same topic — several news stories about one event, a cluster of reviews of one product — into a single summary, which adds the problem of detecting and removing redundancy across documents.1
Generic vs. query-focused. A generic summary answers what is this document about?
with no further guidance. A query-focused (or
topic-focused) summary answers what does this document say about ?
for a
user query , keeping only the material relevant to . Query-focused
summarization is essentially long-form
question answering:
retrieve or condition on the query, then generate the answer from the source.
Extractive vs. abstractive. This is the axis that shapes the algorithm.
Extractive summaries are guaranteed grammatical (every sentence was written by a human) and factually faithful to the source (they only copy), but they read choppily and cannot compress within a sentence or fuse information across sentences. Abstractive summaries read like something a person would write and can compress far more, at the cost of two hazards: disfluency, which modern neural models solved, and factual errors — a summary that asserts something the source does not — which remain the open problem. Historically extractive methods came first and are still the more reliable choice when faithfulness matters most; neural sequence-to-sequence models made abstractive summarization practical and are now the dominant approach.1
Extractive summarization
Extractive summarization reduces to one question: which sentences are worth keeping? Score every sentence in the document for importance, then take the top-scoring few (up to a length budget), and emit them in their original order. The methods differ only in how they compute the score.
Scoring by position and content
Two simple signals go a long way. The first is position. In news writing the lead sentences carry the gist — the inverted-pyramid convention front-loads the who-what-where — so sentence position alone is a strong baseline: keep the first few sentences and you have a summary that is hard to beat cheaply. The strength of the position signal is genre-dependent (it is powerful for news, weaker for scientific papers whose contributions surface in the abstract and conclusion), so a position score is really a learned prior over where important sentences live in a given kind of document.
The second signal is content: a sentence is important if it contains the document's important words. Score a word by TF-IDF — high if it is frequent in this document but rare across the corpus, which zeroes out words like the, of, and and — and score a sentence by the weight of the words it carries. A clean version of this is the centroid method: represent the document by the average (centroid) of its sentence vectors, and score each sentence by its cosine similarity to that centroid. A sentence close to the centroid is close to the document's overall topic; a sentence far from it is a digression.
A summary should not just be important sentences — it should be non-redundant important sentences, since two sentences that say the same thing waste half the budget. Maximal marginal relevance (MMR) handles this greedily: add sentences one at a time, and at each step pick the sentence that best trades off high importance against low similarity to what is already in the summary,
so a sentence that duplicates one already chosen is penalized by the second term. Redundancy removal is what makes MMR the natural choice for multi-document summarization, where the same fact appears in many sources.1
Graph methods: TextRank and LexRank
The centroid method measures whether a sentence is close to the document average; a graph method measures whether it is close to many other sentences. The idea is to build a graph whose nodes are sentences and whose edges join similar sentences, then rank a sentence by how central it is in that graph — a sentence that many others resemble is, by a kind of vote, a good representative of the document.
Centrality is measured by PageRank, the same algorithm that ranks web pages by treating links as votes.2 Think of a random walker hopping between sentences along similarity edges: it lands most often on sentences that many edges point to, and those hitting-probabilities are the centrality scores. Because the score of a sentence depends on the scores of its neighbors, which depend on their neighbors, PageRank is computed by iterating a fixed-point update until the scores stop changing.
The recipe is called TextRank when the similarity is a simple word-overlap count and LexRank when it is cosine similarity of TF-IDF (or embedding) sentence vectors; the graph algorithm is identical. Written out, with a damping factor (usually ) that mixes the neighbor-vote term with a uniform restart:
- 1input: sentences ; similarity threshold ; damping ; budget
- 2for each pair with do
- 3
- 4if then
- 5prune weak edges
- 6for alluniform initialization
- 7repeat
- 8for each sentence do
- 9
- 10until scores converge
- 11sort sentences by descending
- 12return the top sentences, emitted in document order
In the one-line update, sentence 's new score is a small uniform floor plus times a weighted sum of its neighbors' scores, where each neighbor distributes its score across its edges in proportion to their weights. Iterate and the scores settle into the stationary distribution of the random walk. Graph methods are unsupervised — no training data, just the document — which is their great advantage, and why TextRank/LexRank were standard extractive summarizers for years.2
A worked TextRank iteration
For a concrete run of the update, take the five-sentence graph above and read off its weighted adjacency: links to ; links to ; links to ; links only to ; and links only to . Give every edge unit weight for clarity, use damping , and start each sentence at the uniform score . The floor term is fixed at for every sentence, every iteration.
The neighbor-vote term for collects, from each neighbor that points at , that neighbor's current score split across 's out-edges. has two out-edges so it sends ; likewise sends ; has one out-edge so it sends its whole . The first update for is therefore
Doing the same arithmetic for the others in the same sweep gives (votes from 's split half and 's whole score), , , and (nothing points at it). Central has already pulled ahead; peripheral , a pure sink for probability, has collapsed to the floor.
The exact numbers drift for a sweep or two and then settle; what matters is that the order stabilizes almost immediately. leads, and tie behind it, trails, and is last. With a budget of two sentences the summarizer returns and one of the tied pair, emitted in document order. Notice the mechanism that makes centrality work: contributes little on its own, but by pointing all its score at it amplifies the sentence many others already favor. Centrality is votes weighted by the voter's own standing, exactly PageRank.
Supervised sentence selection
If you have documents paired with human summaries, sentence selection can be learned rather than scored by hand. Frame it as binary classification: for each sentence, predict include-in-summary or not. To build the training labels, align each human-summary sentence to the source sentence it most overlaps and mark that source sentence positive; everything else is negative. A classifier — today a transformer that reads each sentence in the context of the whole document and fine-tunes a per-sentence keep/drop head — then learns which combination of position, content weight, and centrality signals predicts a kept sentence, folding the hand-designed scores above into learned features.3
Extractive selection is the safe half of summarization: it can rank and keep the sentences that carry the meaning, but it can never compress within a sentence, fuse two sentences, or paraphrase. Doing any of those means generating new text. This continues in Abstractive Summarization and Evaluation, which builds the generative summarizer and the metrics that score every summary.
Footnotes
- Jurafsky & Martin, Speech and Language Processing (3rd ed.), §9.9 — Contextual Generation and Summarization: text summarization as context-based autoregressive generation; the append-a-summary-with-a-separator scheme converting each article–summary pair into one training instance trained with teacher forcing; priming with the article at inference; the CNN/DailyMail news corpus; and single- vs. multi-document and generic vs. query-focused as task variants. ↩ ↩2 ↩3 ↩4
- Jurafsky & Martin, §9.9 (extractive summarization) — extractive summarization by scoring and selecting sentences, and unsupervised graph-based centrality (TextRank/LexRank) that ranks sentences by PageRank over a sentence-similarity graph, presented here at that level of detail; PageRank centrality as similarity-weighted neighbor voting with a damping/restart term. ↩ ↩2
- Jurafsky & Martin, §9.9.1 — Applying Transformers to other NLP tasks: pretraining a transformer language model self-supervised on a large corpus and then finetuning on a smaller task-specific dataset; denoising pretraining objectives (BART-style corruption/reconstruction, PEGASUS-style gap-sentence generation) and zero-/few-shot prompting of large language models as the modern route to summarization. ↩
╌╌ END ╌╌