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.
- 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
| Component | Purpose |
|---|---|
| Streamlit | Web interface |
| Hugging Face Transformers | Summarization pipeline |
| PyTorch | Model backend |
facebook/bart-large-cnn |
Pretrained summarization model |
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.pyThe 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.
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"]- 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.
- Split long documents into chunks and summarize each
- Adjustable summary length slider
- Upload
.txt/.pdffiles - Option to choose between different summarization models
- Deploy on Streamlit Community Cloud or Hugging Face Spaces
summify-text-summarizer/
├── app.py
├── requirements.txt
├── README.md
└── docs/
└── screenshot.png
MIT (add a LICENSE file when you create the repo).
