✨ A dual-mode summarization app using Abstractive (BART) and Extractive (TextRank) methods. Built with Streamlit and cutting-edge NLP libraries for efficient and human-like summarization.
- 🧠 Abstractive Summarization via Facebook's BART model
- 🧩 Extractive Summarization using a custom TextRank algorithm
- 🔀 Comparison Mode to view both summaries side-by-side
- 📏 Compression Ratio & Word Count Metrics
- 🔧 Real-time configuration of summary length/sentence count
- 📎 Intelligent text chunking for long documents
- 📜 Preloaded sample texts and word count validation
- 💻 Streamlit-powered responsive UI with progress indicators
Component | Tool/Library |
---|---|
Abstractive Model | facebook/bart-large-cnn (Transformers) |
Extractive Method | Custom TextRank with TF-IDF & cosine similarity |
Graph Algorithm | PageRank via NetworkX |
Tokenization | NLTK (punkt , stopwords ) |
Frontend | Streamlit |
ML Tools | scikit-learn, PyTorch, NumPy |
git clone https://github.com/akasha456/TextSummarizer
cd TextSummarizer
pip install -r requirements.txt
streamlit run app.py
flowchart TD
A[User Inputs Text] --> B[Text Preprocessing]
B --> C[Abstractive → BART Model]
B --> D[Extractive → TextRank + TF-IDF]
C --> E[Generated Summary]
D --> E
E --> F[Display in Streamlit with Metrics]
Mode | Parameters |
---|---|
Abstractive | Max Length: 50–300 (default: 150) Min Length: 20–100 (default: 50) |
Extractive | Number of Sentences: 1–10 (default: 3) |
text-summarizer/
├── app.py # Streamlit frontend
├── summarizers.py # BART & TextRank implementations
├── utils.py # Text processing utilities
├── config.py # Constants and app settings
├── requirements.txt # Python dependencies
└── README.md # Project documentation
- ⚡ Caching for BART model and NLTK downloads
- 📦 Chunking logic to handle large inputs
- 🧩 TF-IDF Cosine Similarity + PageRank for extractive scoring
- ❗ Error Handling with user-friendly messages
Includes the following built-in examples:
- 🧠 Technology – AI and ML overview
- 🌍 Scientific – Climate change research
Metric | Description |
---|---|
Compression Ratio | Percentage reduction in summary |
Word Count | Real-time display of input length |
Processing Time | UI-based feedback while generating summary |
- Fork the repository
- Create a new branch:
git checkout -b feature/your-feature
- Commit your changes:
git commit -m "Add awesome feature"
- Push the branch:
git push origin feature/your-feature
- Submit a Pull Request 🚀
This project is licensed under the MIT License.
- Facebook AI for the BART model
- Hugging Face Transformers
- NetworkX for graph-based algorithms
- Streamlit for the web interface
- NLTK and scikit-learn for NLP utilities