Skip to content
Krishna9904Public

About

Streamlit app that summarizes pasted text using Hugging Face's pretrained BART (facebook/bart-large-cnn) model. Generates concise abstractive summaries (30-130 tokens), caches the model for fast repeat use, and handles empty input gracefully.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

📝 Summify

A lightweight text summarization web app built with Streamlit and Hugging Face Transformers. Paste a paragraph or article and get a concise summary generated by the pretrained facebook/bart-large-cnn model.

Features

  • Abstractive summarization using a BART transformer
  • Simple, clean Streamlit interface
  • Model loaded once and cached with st.cache_resource, so repeat summaries are fast
  • Friendly warning when the input is empty
  • Deterministic output (do_sample=False), with summaries of 30-130 tokens

Demo

Summify screenshot

Tech stack

Component Purpose
Streamlit Web interface
Hugging Face Transformers Summarization pipeline
PyTorch Model backend
facebook/bart-large-cnn Pretrained summarization model

Getting started

Requirements: Python 3.9+

git clone https://github.com/<your-username>/summify-text-summarizer.git
cd summify-text-summarizer

python -m venv venv
venv\Scripts\activate        # Windows
# source venv/bin/activate   # macOS / Linux

pip install -r requirements.txt
streamlit run app.py

The app opens at http://localhost:8501.

Note: The first run downloads the model (about 1.6 GB), so startup will be slow once. After that it loads from the local cache.

How it works

Pasted text
     ↓
Hugging Face summarization pipeline (BART)
     ↓
Summary (30-130 tokens)
     ↓
Displayed in Streamlit

Core of the app:

summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
summary = summarizer(text, max_length=130, min_length=30, do_sample=False)[0]["summary_text"]

Limitations

  • BART accepts roughly 1,024 tokens of input. Very long text may be truncated or cause an error.
  • The model is trained mainly on news articles (CNN/DailyMail), so it works best on news-style text.
  • Runs on CPU by default, so long inputs can take several seconds.
  • Summaries are abstractive and can occasionally contain inaccuracies, so check important facts against the source.

Roadmap

  • Split long documents into chunks and summarize each
  • Adjustable summary length slider
  • Upload .txt / .pdf files
  • Option to choose between different summarization models
  • Deploy on Streamlit Community Cloud or Hugging Face Spaces

Project structure

summify-text-summarizer/
├── app.py
├── requirements.txt
├── README.md
└── docs/
    └── screenshot.png

License

MIT (add a LICENSE file when you create the repo).

About

Streamlit app that summarizes pasted text using Hugging Face's pretrained BART (facebook/bart-large-cnn) model. Generates concise abstractive summaries (30-130 tokens), caches the model for fast repeat use, and handles empty input gracefully.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages