The problem
Information now arrives faster than anyone can read it: papers, articles and PDFs pile up while reading time stays fixed. Skimming helps but misses the point; reading everything is impossible. Automatic summarization is the obvious answer, but the old extractive approach — copying the most "important" sentences — produces choppy, redundant output that reads poorly. Abstractive summarization, where the model rewrites the content in its own words, is the harder and more useful problem, and transformers made it practical: pre-trained models like BART and T5 already understand language, so fine-tuning them on summarization data yields fluent summaries. The remaining questions are engineering ones — how to chunk long documents, how to evaluate a summary honestly, and where the model hallucinates. This project works through all of them: fine-tuning on CNN/DailyMail, an extractive baseline for honest comparison, ROUGE evaluation, and an app that summarizes articles and PDFs with the evidence highlighted.
How it works
- The user pastes article text, uploads a PDF or submits an article URL.
- Text is extracted (PDF parsing, article scraping) and cleaned; long documents are chunked with overlap.
- Each chunk is tokenized and fed to the fine-tuned BART/T5 model, which generates an abstractive summary per chunk.
- Chunk summaries are merged and re-summarized into the final concise output.
- The app displays the summary with compression ratio, estimated reading-time saved and key-sentence highlights.
- In evaluation mode, summaries are scored with ROUGE-1/2/L against reference summaries from CNN/DailyMail.
- The comparison dashboard shows BART vs T5 vs extractive baseline bars for the report.
Project features
- Abstractive summarization with fine-tuned BART and T5 models
- Extractive baseline (TextRank/LexRank) included for honest comparison
- PDF and article-URL input: text extraction, chunking for long documents
- BrieflyAI Streamlit/Flask app: paste text or upload PDF, get instant summary
- Compression-ratio badge and reading-time savings per summary
- Key-sentence highlights showing which source passages drove the summary
- ROUGE-1/2/L evaluation dashboard comparing BART, T5 and the extractive baseline
- Adjustable summary length (short/medium/detailed) via generation parameters
- Batch mode: summarize a folder of articles into one report
- Fine-tuning pipeline documented end-to-end on the CNN/DailyMail dataset
What is included
- Complete, commented Python source code (preprocessing, fine-tuning, inference, app)
- Fine-tuned BART/T5 model weights ready to load and demo
- BrieflyAI Streamlit/Flask application
- Project report PDF (literature survey, abstractive vs extractive theory, ROUGE results, comparison tables)
- PPT presentation
- Viva Q&A document (transformer attention, BART vs T5, ROUGE internals, fine-tuning)
- Setup guide (environment, dependencies, dataset download steps)
FAQs
- Why is abstractive summarization a good NLP topic? It is generation, not classification — the model rewrites content in its own words. Fine-tuning BART/T5, with an extractive baseline for comparison and ROUGE evaluation, gives a complete, current NLP pipeline.
- What is the difference between abstractive and extractive summarization? Extractive methods copy the most important sentences; abstractive models generate new sentences. The project implements both and compares them with ROUGE.
- Which models are used? BART-large and T5-base from Hugging Face, fine-tuned on the CNN/DailyMail dataset, with a TextRank extractive baseline for comparison. The fine-tuning pipeline is fully documented.
- Is a GPU needed? Only for fine-tuning — free Kaggle/Colab GPUs suffice. The delivered fine-tuned model summarizes articles and PDFs on a normal CPU laptop.
- Can it be demoed live? Yes — paste an article or upload a PDF and the app returns the summary with compression ratio, key-sentence highlights and reading-time savings.
- What are the natural extensions? Multi-document summarization, a browser extension for one-click article summaries, multilingual summarization with mT5, or a meeting-transcript summarizer.
Limitations & prerequisites
- Abstractive models can hallucinate details; the report documents this and shows mitigation via highlights.
- Very long PDFs (100+ pages) are chunked, so cross-document coherence is weaker than single-article summaries.
- ROUGE measures word overlap, not meaning — the report explains why it is the standard metric despite this.
- Fine-tuning needs a GPU; inference-only use on CPU works but is slower for long documents.
Components & software requirements
- Python 3.9+ (NumPy, Pandas, scikit-learn)
- Hugging Face Transformers (BART, T5 tokenizers and models)
- PyTorch (fine-tuning and inference backend)
- Streamlit/Flask (BrieflyAI app)
- PDF/article text extraction pipeline
- ROUGE scoring library for evaluation
Specifications
| Parameter | Value |
|---|---|
| Models | BART-large / T5-base, fine-tuned; TextRank extractive baseline |
| Fine-tuning data | CNN/DailyMail summarization dataset (documented pipeline) |
| Inputs | Pasted text, PDF upload, article URL |
| Long documents | Overlapping chunking with merge-and-resummarize |
| Key metrics | ROUGE-1/2/L F1; fine-tuned BART typically ~0.40–0.45 ROUGE-1 on CNN/DailyMail |
| Summary lengths | Short (~3 sentences), medium, detailed — adjustable |
| Compression | Reported per summary (typically 85–95% text reduction) |
| Inference | CPU-capable for demo lengths; GPU recommended for batch fine-tuning |
| App | Streamlit/Flask; summary card, highlights, download, evaluation dashboard |
| Export | Summary download as TXT/PDF; batch mode compiles multi-article reports |