Built to order

News Article Summarization using T5 Transformer (CNN/DailyMail Dataset)

This project fine-tunes the T5-base transformer on the CNN/DailyMail news corpus (287,113 training articles) so it reads a full news article and writes a short abstractive summary in its own words, evaluated with ROUGE-1/2/L against human-written highlights. The interactive web demo runs a genuine extractive baseline in the browser for instant tries; the shipped deliverable includes the real T5 fine-tuning notebook, trained T5-base weights and the full ROUGE evaluation. Suitable for B.E./B.Tech final-year projects in Computer Science, IT and AI & Machine Learning.

AI & Machine Learning Hugging Face TransformersJupyter notebookGitT5-basePython 3 · PyTorchCNN/DailyMail datasetROUGE evaluationJavaScript web demoSoftware
News Article Summarization using T5 Transformer (CNN/DailyMail Dataset) — project thumbnail preview
More project photos (2)

The problem

News readers face a volume problem: hundreds of long articles appear daily, and few readers get past the headline. Newsrooms have always handled this with hand-written highlights, but producing them is manual and inconsistent at scale. Automatic summarization promises a highlight for every article, instantly. The catch is that simple extractive methods can only copy existing sentences, so their summaries read disjointed and miss points spread across paragraphs. This project goes the full deep-learning route: the T5-base transformer is fine-tuned on the CNN/DailyMail corpus of over 300,000 articles paired with author-written highlights, learning to read an article and rewrite its essence in its own words. Generation quality is judged with ROUGE, the standard n-gram-overlap metric of summarization research, against an extractive baseline and a lead-sentences heuristic so the transformer's contribution is measured, not assumed.

SYSTEM FLOW

7 components 8 connections

Live flow
Drag to explore
100%
storageCNN/DailyMail

CNN/DailyMail v3.0.0: 287,113 training, 13,368 validation and 11,490 test article-highlight pairs, truncated to 512 input tokens.

Follow the working sequence

How it works

  1. Articles and highlights are loaded from Hugging Face (cnn_dailymail v3.0.0: 287,113 train, 13,368 validation, 11,490 test), cleaned of bylines and boilerplate, and truncated to 512 input tokens.
  2. Each article is prefixed with "summarize:" and tokenized with the T5 SentencePiece tokenizer (32k vocabulary), framing summarization as T5's native text-to-text task.
  3. T5-base is fine-tuned with teacher-forced cross-entropy, the AdamW optimizer, a learning rate near 5e-5 and 3–5 epochs on a single GPU (design targets), with mixed precision and gradient accumulation.
  4. Checkpoints are selected by validation ROUGE-L; generation uses beam search (4 beams, length penalty tuned on validation) capped at 150 output tokens.
  5. Final ROUGE-1/2/L F1 scores are computed once on the held-out 11,490-article test split, alongside the extractive and lead-sentence baselines run on the same split.
  6. In the web demo, pasted articles are summarized through the trained model (the bundled instant demo runs the extractive baseline in-browser), and ROUGE against editorial highlights is computed live.

Tech stack:

  • Python 3, PyTorch, Hugging Face Transformers
  • T5-base (220M parameters), SentencePiece tokenizer
  • cnn_dailymail v3.0.0 (Hugging Face Datasets)
  • rouge-score (Google Research), NLTK
  • Jupyter Notebook (training & evaluation)
  • Single-file HTML/CSS/JavaScript web demo
  • Flask inference wrapper (model API)
  • Git

Dataset & model details

  • Dataset: CNN/DailyMail news summarization corpus (Hermann et al., 2015), Hugging Face cnn_dailymail v3.0.0 — 287,113 training, 13,368 validation and 11,490 test article–highlight pairs; mean 781 article tokens and 56 highlight tokens; fields id, article, highlights.
  • Task: Abstractive summarization; input = full news article (512 tokens max, design target) prefixed "summarize:", output = generated highlights-style summary (150 tokens max, design target).
  • Model: T5-base encoder–decoder transformer (Raffel et al., JMLR 2020) — 12 encoder + 12 decoder blocks, approximately 220,000,000 parameters; trained with teacher-forced cross-entropy, AdamW, learning rate near 5e-5, 3–5 epochs (design targets).
  • Metrics: ROUGE-1/ROUGE-2/ROUGE-L F1 (Lin, 2004) against reference highlights. Design targets for the buyer's training run: ROUGE-1 ≈ 0.42, ROUGE-2 ≈ 0.20, ROUGE-L ≈ 0.40. No score is claimed as measured until the training run executes.
Parameter Value
Dataset cnn_dailymail v3.0.0, Hugging Face (datasheet)
Training articles 287,113 (datasheet)
Validation / test articles 13,368 / 11,490 (datasheet)
Model T5-base, approximately 220,000,000 parameters (datasheet)
Max input length 512 tokens (design target)
Max summary length 150 tokens (design target)
ROUGE-1 / ROUGE-2 / ROUGE-L ≈ 0.42 / 0.20 / 0.40 (design targets, not measured claims)
Training hardware 1 GPU with 16+ GB VRAM (expected)
Training time Approximately 10–18 hours on a single A100-class GPU (expected)
Inference Approximately 1–3 seconds per article on GPU (expected)
Demo Single-file web app; in-browser extractive baseline runs offline

Project features

  • [Fine-tuned T5-base abstractive summarizer] T5-base (220M parameters) trained on 287,113 CNN/DailyMail articles to generate highlights-style summaries in its own words — genuine abstractive NLP, not sentence extraction.
  • [Interactive web demo] Paste any news article and get a summary with word counts and compression ratio; four bundled news-style samples included for instant tries.
  • [Live in-browser ROUGE workbench] The demo computes ROUGE-1/2/L F1 live in JavaScript against editorial highlights for each sample, shown next to the fine-tuned model's design targets.
  • [Honest baseline comparisons] An extractive word-frequency summarizer and a lead-sentences heuristic are implemented so the report's comparison table measures what the transformer actually adds.
  • [Complete training notebook] Data loading from Hugging Face, SentencePiece tokenization with the "summarize:" prefix, the fine-tuning loop, checkpointing and evaluation in one reproducible notebook.
  • [Evaluation and failure analysis] ROUGE curves, sample input/output pairs and a 200-output hallucination spot-check, reported honestly rather than cherry-picked.
  • [Inference wrapper] The trained weights served behind a simple API with exposed generation settings (beams, length penalty, max tokens), wired to the web demo.

What is included

  • Complete T5 fine-tuning and evaluation Jupyter notebook
  • Trained T5-base weights and tokenizer files
  • Web demo (single-file app) with inference wrapper wired to the trained model
  • ROUGE evaluation report with baseline comparison table and failure analysis
  • Project report PDF (transformer background, methodology, results, hallucination audit)
  • PPT presentation for final review
  • Viva Q&A preparation document (transformers, attention, fine-tuning, ROUGE, baselines)

Limitations & prerequisites

  • English-language news only — CNN/DailyMail covers two English outlets, so other languages and domains degrade and are out of scope.
  • Abstractive models can hallucinate: the report quantifies this on a 200-output spot check (measured on the training run) instead of hiding it.
  • Inputs are truncated to 512 tokens (design target), so details buried late in very long articles can be lost.
  • ROUGE figures are design targets, stated honestly — no score is claimed as measured until the buyer's training run executes.
  • The instant browser demo runs an extractive baseline, not T5; the real model needs the shipped weights and GPU time.
  • Training t5-base needs a GPU with 16+ GB VRAM (expected) — CPU-only training is not practical.

Frequently Asked Questions

Which dataset is used and why?

The CNN/DailyMail corpus (Hermann et al., 2015), version 3.0.0 on Hugging Face: 287,113 training articles, each paired with the author-written highlights that serve as the reference summary. It is the standard benchmark for news summarization, large enough to fine-tune a transformer properly and directly comparable with published results.

Why T5 instead of an extractive method?

Extractive methods only copy existing sentences, so summaries read disjointed and cannot compress ideas spread across paragraphs. T5 is an encoder–decoder transformer that generates new phrasing — genuinely abstractive. The project ships both, so the report measures exactly what the transformer adds over the extractive baseline.

Does the web demo run the T5 model?

No, and this is stated upfront. A fine-tuned T5 cannot run inside a web page, so the instant demo runs a real extractive summarizer in JavaScript (word-frequency sentence scoring) with live ROUGE computation. The shipped order includes the actual fine-tuned T5-base weights, training notebook and ROUGE evaluation.

What ROUGE scores will the trained model get?

The design targets for the buyer's training run are ROUGE-1 ≈ 0.42, ROUGE-2 ≈ 0.20 and ROUGE-L ≈ 0.40 (F1). These are honest targets, not promises — the report documents the actual achieved scores after training, alongside baseline comparisons on the same test split.

What hardware does training need?

A single GPU with 16+ GB VRAM is expected (approximately 10–18 hours on an A100-class GPU). The notebook uses mixed precision and gradient accumulation to fit, but CPU-only training of a 220M-parameter model is not practical and is not attempted.

Is this project suitable for a final-year project?

Yes — for Computer Science, IT and AI/ML programs. It demonstrates dataset handling at scale, transformer fine-tuning with Hugging Face, seq2seq training discipline, honest ROUGE evaluation against baselines, and a working deployment demo. The report, PPT and viva Q&A document every design decision, so the student can defend the architecture, the metric choices and the results confidently in the final review.

Components & software requirements
  • Python 3, PyTorch, Hugging Face Transformers
  • T5-base (220M parameters), SentencePiece tokenizer
  • cnn_dailymail v3.0.0 (Hugging Face Datasets)
  • rouge-score (Google Research), NLTK
  • Jupyter Notebook (training & evaluation)
  • Single-file HTML/CSS/JavaScript web demo
  • Flask inference wrapper (model API)
  • Git

Dataset & model details

  • Dataset: CNN/DailyMail news summarization corpus (Hermann et al., 2015), Hugging Face cnn_dailymail v3.0.0 — 287,113 training, 13,368 validation and 11,490 test article–highlight pairs; mean 781 article tokens and 56 highlight tokens; fields id, article, highlights.
  • Task: Abstractive summarization; input = full news article (512 tokens max, design target) prefixed "summarize:", output = generated highlights-style summary (150 tokens max, design target).
  • Model: T5-base encoder–decoder transformer (Raffel et al., JMLR 2020) — 12 encoder + 12 decoder blocks, approximately 220,000,000 parameters; trained with teacher-forced cross-entropy, AdamW, learning rate near 5e-5, 3–5 epochs (design targets).
  • Metrics: ROUGE-1/ROUGE-2/ROUGE-L F1 (Lin, 2004) against reference highlights. Design targets for the buyer's training run: ROUGE-1 ≈ 0.42, ROUGE-2 ≈ 0.20, ROUGE-L ≈ 0.40. No score is claimed as measured until the training run executes.
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and email — the synopsis PDF downloads immediately. We may send occasional project updates; no spam, unsubscribe anytime.

Get a quotation