Skip to content

NLP · TOOL

A lightweight summarizer for academic text that runs offline

A small Gradio app that turns pasted academic text into a short summary with DistilBART, using a copy of the model saved on my own machine. I built it because summarizing paper after paper by hand was slowing down my literature reviews.

The abstract of my IEEE Access survey next to the summary DistilBART wrote for it: 308 words in, 44 out.

THE GAP

A literature review means summarizing one long paper after another.

As a graduate researcher I regularly had to read and summarize long papers and journal articles. It's slow, tiring work, and it holds up the part of a review that matters most: putting the ideas together.

01

Long documents

Research papers and journal articles are long, and a good summary takes a careful read.

02

Every paper, again

A review means doing that for paper after paper, and the time adds up fast.

03

Tiring work

It's routine and mentally draining, and it slows down the synthesis the review is for.

WHAT IT DOES

Paste text, get a summary, on your own machine

It's a Gradio page with two boxes and two buttons. Paste an abstract, a section or an article on the left, press Generate Summary, and DistilBART writes a summary on the right. The model loads from a local snapshot, so once it's downloaded the app runs without a network connection.

The image at the top is a real run of the same checkpoint: the abstract of my IEEE Access survey, 308 words in and 44 out.

Runs offline

The model loads from a saved snapshot on disk, so after one download it runs without a connection.

A distilled model

distilbart-cnn-12-6 has 306M parameters against 406M for BART-large-CNN, per its model card.

Checkpoint defaults

The checkpoint's own settings apply: beam search with 4 beams and summaries of 56 to 142 tokens.

Clear errors

Empty or too-short input gets a message instead of a model call, and model errors show in the app.

HOW IT WORKS

Paste, check, summarize

  1. 1

    Paste

    Drop an abstract, a paper section or an article into the input box.

  2. 2

    Check

    Empty text or anything under five characters gets a message, not a model call.

  3. 3

    Summarize

    DistilBART generates a summary of 56 to 142 tokens with beam search.

  4. 4

    Read

    The summary appears on the right, and the input box clears.

  5. 5

    Clear

    One click empties both boxes for the next piece of text.

SYSTEM DESIGN

One file, one model

The whole app is 84 lines of Python: a Gradio page, a validation function and a Hugging Face summarization pipeline pointed at a local copy of the model.

RESULTS

The tool in numbers

84

lines of Python for the whole app

306M

parameters, against 406M for BART-large-CNN

1,024

tokens the model can read in one request

56–142

tokens per summary, from the checkpoint's defaults

These describe the tool, not its quality. The ROUGE scores on the model card are for news, and the repo has no evaluation on academic text.

WHAT IT TAUGHT ME

Honest limits

The model was fine-tuned on CNN/DailyMail news articles, not papers, so academic writing is outside what it learned from, and nothing in the repo measures how well it does there. It also reads at most 1,024 tokens, and the app passes text in one piece without splitting it. On CPU, a 1,382-token input fails with an index error, so longer text has to go in a section at a time.

BUILT WITH

  • Python
  • Hugging Face Transformers
  • PyTorch
  • Gradio

Like what you see?

Thanks for reading. There's more where this came from.