Skip to content

Asad-Aziz-001/AI-Text-Summarizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

36 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ AI Text Summarizer

AI Text Summarizer


Python Streamlit HuggingFace PyTorch


Live Demo License Status Model


Paste any text. Get a crisp 2–3 line summary. Instantly.
Built with T5-Small, HuggingFace Transformers, and Streamlit β€” deployed on the cloud.

Live Demo


πŸ–ΌοΈ Preview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                               β”‚
β”‚   ✦ Powered by T5 Β· Transformers             β”‚
β”‚                                               β”‚
β”‚   AI Text                                     β”‚
β”‚   Summarizer                                  β”‚
β”‚   ──────                                      β”‚
β”‚                                               β”‚
β”‚   [ Paste your text here...           ]       β”‚
β”‚                                  0 chars      β”‚
β”‚                                               β”‚
β”‚   ⚑ Generate Summary                        β”‚
β”‚                                               β”‚
β”‚   ✦ SUMMARY                                  β”‚
β”‚   Your intelligent summary appears here...   β”‚
β”‚                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

✨ Features

Feature Description
πŸ€– AI Summarization Uses Google's T5-Small model for intelligent text summarization
⚑ Instant Results Generates summaries in seconds on CPU
🎨 Modern Dark UI Custom dark theme with gradient accents and smooth animations
πŸ“Š Live Char Counter Real-time character count as you type
πŸ”’ Model Caching @st.cache_resource ensures model loads only once
☁️ Cloud Deployed Live on Streamlit Cloud β€” no setup needed
πŸ“± Responsive Works on desktop and mobile browsers

πŸ› οΈ Tech Stack

Layer Technology
Frontend Streamlit + Custom CSS
ML Model T5-Small (HuggingFace)
Framework HuggingFace Transformers
Deep Learning PyTorch (CPU mode)
Hosting Streamlit Cloud
Language Python 3.14

πŸš€ Getting Started

Prerequisites

Make sure you have Python installed:

python --version  # 3.9+ recommended

Installation

1. Clone the repository

git clone https://github.com/asad-aziz-001/ai-text-summarizer.git
cd ai-text-summarizer

2. Install dependencies

pip install -r requirements.txt

3. Run the app

streamlit run app.py

4. Open in browser

http://localhost:8501

πŸ“¦ Requirements

streamlit
transformers>=4.45.0,<5.0.0
torch>=2.9.0
sentencepiece

πŸ“ Project Structure

ai-text-summarizer/
β”‚
β”œβ”€β”€ app.py               # Main Streamlit application
β”œβ”€β”€ requirements.txt     # Python dependencies
└── README.md            # Project documentation

πŸ’‘ How It Works

User Input Text
      β”‚
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Streamlit  β”‚  ← Web Interface
β”‚     UI      β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   T5-Small  β”‚  ← HuggingFace Pipeline
β”‚    Model    β”‚     (Cached on first load)
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β–Ό
  Summary Output
  (2–3 sentences)
  1. User pastes text into the input area
  2. Clicks ⚑ Generate Summary
  3. Text is passed to the summarization pipeline
  4. T5-Small model processes and compresses the text
  5. Clean summary is displayed in the result card

🎨 UI Highlights

  • Color Palette β€” Deep navy (#0a0a0f) with neon green (#7fffb2) and cyan (#3af0ff) accents
  • Typography β€” Syne for headings, DM Sans for body text
  • Gradient Title β€” White β†’ Green β†’ Cyan animated gradient
  • Glow Effects β€” Subtle radial gradients on background
  • Animated Button β€” Hover lift with shadow bloom
  • Result Card β€” Gradient top border with glassmorphism background

βš™οΈ Configuration

You can tweak summarization behavior in app.py:

summary = summarizer(
    input_text,
    max_length=60,   # Maximum summary length (tokens)
    min_length=20,   # Minimum summary length (tokens)
    do_sample=False  # Deterministic output
)
Parameter Default Description
max_length 60 Max tokens in summary
min_length 20 Min tokens in summary
do_sample False Greedy decoding (consistent results)
device -1 -1 = CPU, 0 = GPU

πŸ§ͺ Test Inputs

Try these sample texts to test the app:

πŸ€– Technology
Artificial intelligence is rapidly transforming industries across the globe. From healthcare to finance, AI-powered systems are automating complex tasks, improving accuracy, and reducing costs. Machine learning algorithms can now detect diseases from medical images with higher accuracy than human doctors. In finance, AI is used for fraud detection, algorithmic trading, and personalized banking. However, concerns about job displacement, data privacy, and algorithmic bias continue to grow as AI becomes more integrated into daily life.
🌍 Climate Change
Climate change is one of the most pressing challenges facing humanity today. Rising global temperatures caused by greenhouse gas emissions are leading to more frequent and intense natural disasters, including hurricanes, floods, and wildfires. Sea levels are rising, threatening coastal cities around the world. Scientists warn that without immediate and drastic action to reduce carbon emissions, the consequences could be irreversible.
πŸ‡΅πŸ‡° Pakistan Tech
Pakistan is one of the world's fastest-growing digital economies. With over 100 million internet users and a young population, the country has seen a boom in e-commerce, fintech, and freelancing. Pakistani freelancers rank among the top earners globally on platforms like Upwork and Fiverr. The government has launched several digital initiatives to improve connectivity in rural areas and promote tech startups.

🀝 Contributing

Contributions are welcome! Feel free to:

  • πŸ› Report bugs via Issues
  • πŸ’‘ Suggest features
  • πŸ”§ Submit pull requests

πŸ“„ License

This project is licensed under the MIT License β€” feel free to use, modify, and distribute.


Made with ❀️ by Asad Aziz

GitHub

LinkedIn

Portfolio

If this helped you, please ⭐ star the repo!

About

AI is revolutionizing industries by automating tasks, boosting efficiency, and enhancing decision-making.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages