DEV Community

Shubham Bawari
Shubham Bawari

Posted on

Sloth Summarizer: Read Less, Know More

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady Submission 🦥

What I Built

Sloth Summarizer is a document summarizer. Paste text or upload a PDF, click one button, and get a short summary in seconds.

Long reports, study notes, and PDFs take time to read. A sloth would not read 20 pages. This tool reads them for you and gives you the main points, so students, job seekers, and busy readers can stay a little lazier.

Demo

Live app: https://ai-summarizer9.streamlit.app/

Step 1: Paste text or upload a PDF, then click Summarize

Input screen of Sloth Summarizer with pasted text

Step 2: Get a short summary

Summary output of Sloth Summarizer

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

Code

GitHub repo: https://github.com/shubsolos19/Document-summarizer

How I Built It

  • Model: t5-small from Hugging Face. It is an open-weight model, small enough to run on a normal laptop CPU.
  • Framework: Hugging Face Transformers with PyTorch.
  • PDF reading: PyPDF2 pulls text out of PDF files.
  • Interface: Streamlit web app.

The flow is simple:

  1. Get text from the input box or the PDF.
  2. Split long text into small chunks, because t5-small can only read a limited amount at once.
  3. Summarize each chunk with the model.
  4. Join the chunk summaries into one final summary.

Summary length and chunk size are easy to change in the code (max_length, min_length, max_chars). The whole app is about 150 lines of Python.

Why Does Open Innovation Matter?

  • Works offline: After the first model download, the summarizer runs with no internet. A closed API needs a connection every time.
  • Your documents stay with you: Contracts, notes, and reports are summarized on your own machine. They are not sent to a server you do not control.
  • Free to run: No API key, no per-request bill, no usage limit. Set it up once and use it as much as you want.
  • Swappable: The model is open, so I can swap t5-small for another open model like BART with a small code change. With a closed API, the provider decides which model you get and when it changes.

The Lazy Payoff

Reading a 1000-word document can take several minutes. The app summarizes it in about 4 to 6 seconds on a normal machine. Fewer minutes reading, more time resting like a sloth.

Happy Sloth Day! 🦥

Top comments (0)