Text summarization
Compressing a document to its essence splits into two very different approaches: extractive summarization selects the most important sentences from the original, while abstractive summarization generates new sentences. One is safe but choppy; the other is fluent but can hallucinate. The split, the methods, and ROUGE.
What you'll learn
- Extractive vs abstractive summarization — select vs generate
- Extractive scoring — sentence centrality and TextRank
- Abstractive generation with seq2seq, and the hallucination risk
- ROUGE — recall-oriented evaluation, and why it differs from BLEU
Before you start
Summarization compresses a document to its essence — and there are two fundamentally different ways to do it. Extractive summarization selects the most important sentences from the original and stitches them together. Abstractive summarization generates new sentences that may not appear anywhere in the source, the way a person would paraphrase. The choice between them is a choice between safety and fluency.
Extractive: select the important sentences
Extractive methods score each sentence for importance and keep the top few. The classic scorer is TextRank — run PageRank on a graph where sentences are nodes and edges are their similarity. The intuition is the same as ranking web pages: a sentence is important if it’s similar to many other important sentences — central to the document. A simple version just scores each sentence by its total similarity to the rest:
sentences = ["the cat sat on the mat", "the cat is a pet animal", "stocks fell sharply today"]
def words(s): return set(s.split())
def sim(a, b):
wa, wb = words(a), words(b)
return len(wa & wb) / (len(wa | wb) or 1) # Jaccard overlap
scores = [sum(sim(s, t) for t in sentences if t != s) for s in sentences]
for sc, s in sorted(zip(scores, sentences), reverse=True):
print(f"{sc:.3f} {s!r}")
0.222 'the cat sat on the mat'
0.222 'the cat is a pet animal'
0.000 'stocks fell sharply today'
The two cat sentences reinforce each other (they overlap), so they’re central and rank high; the unrelated finance sentence shares nothing, scores zero, and is dropped. Extractive summaries are safe — every sentence is verbatim from the source, so they can’t fabricate — but they can be choppy and redundant (selected sentences don’t always flow, and may repeat).
Abstractive: generate the summary
Abstractive summarization treats the problem as sequence-to-sequence generation: read the document, generate a short summary in new words — paraphrasing, fusing ideas across sentences, compressing as a human would. It’s far more fluent and natural, and it’s what modern transformer summarizers and LLMs do. The danger is the flip side of generation: hallucination — the model can produce fluent sentences asserting facts that aren’t in the source (or contradict it). A bridge design, the pointer-generator, lets the model copy words directly from the source when it should and generate when it should, reducing fabrication.
Evaluating with ROUGE
Summaries are scored with ROUGE, the recall-oriented cousin of BLEU. Where BLEU (for translation) emphasizes precision — are the candidate’s n-grams correct? — ROUGE emphasizes recall: did the candidate cover the n-grams in the reference summary? That makes sense for summarization, where the worry is leaving important content out. Like BLEU, it’s surface-level and blind to meaning-preserving paraphrase, so it’s a rough proxy, not ground truth.
In one breath
- Summarization has two paradigms: extractive (select important sentences verbatim) and abstractive (generate new sentences).
- Extractive scores sentences by importance — TextRank runs PageRank on a sentence-similarity graph (central sentences win; the demo drops the unrelated one at score 0). It’s safe (no fabrication) but choppy/redundant.
- Abstractive is seq2seq generation — fluent and human-like, but can hallucinate facts not in the source; pointer-generator copies-or-generates to reduce that.
- ROUGE evaluates summaries by recall (did you cover the reference’s n-grams?), versus BLEU’s precision for translation — both surface-level proxies.
- The trade-off is safe-but-choppy vs fluent-but-unfaithful; LLMs made abstractive the default, but faithfulness remains the open problem, so extractive still wins where fabrication is unacceptable.
Quick check
Quick check
Next
Abstractive summarization is seq2seq generation, evaluated with ROUGE (the recall cousin of BLEU); extractive ranking uses graph PageRank. The faithfulness problem is hallucination & grounding.