Skip to content

kdeepak2001/Ai-Text-Summarizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

title AI Text Summarizer
emoji πŸ“
colorFrom blue
colorTo purple
sdk streamlit
sdk_version 1.50.0
app_file streamlit_app.py
pinned false

πŸ“ AI Text Summarizer

Live Demo Python Streamlit License

An intelligent text summarization tool that extracts the most important sentences from any text using extractive summarization powered by word frequency scoring algorithms.

πŸ”— Try the Live Demo


✨ Features

  • πŸ“„ Text Input - Paste or type any text directly
  • 🌐 URL Support - Fetch and summarize content from any webpage
  • βš™οΈ Customizable - Adjust the number of sentences (1-10)
  • πŸ“Š Statistics Dashboard - View original length, summary length, and reduction percentage
  • πŸš€ No API Required - Works completely offline with no external dependencies
  • πŸ’» Dual Interface - Command-line tool and interactive web UI
  • 🎯 High Efficiency - Achieves 95%+ text reduction while preserving key information

🎯 How It Works

The application uses extractive summarization with a word frequency scoring algorithm:

  1. Tokenization - Splits text into sentences and words
  2. Frequency Analysis - Calculates word occurrence frequencies
  3. Sentence Scoring - Assigns scores based on important word frequencies
  4. Position Bonus - Prioritizes sentences from the beginning (often contain key info)
  5. Top Extraction - Selects highest-scoring sentences for the summary

πŸ› οΈ Tech Stack

Core Technologies

Technology Version Purpose
Python 3.13 Core programming language
Streamlit 1.50.0 Interactive web interface framework
BeautifulSoup4 Latest HTML parsing and web scraping
Requests Latest HTTP library for URL fetching

Development Tools

Tool Purpose
Git Version control
GitHub Code repository and collaboration
VS Code Code editor
Python venv Virtual environment management
pip Package management

AI-Assisted Development

Tool Usage
ChatGPT Code debugging and architecture planning
Perplexity Technical research and documentation
Claude Problem-solving and code optimization

Deployment & Hosting

  • Hugging Face Spaces - Free cloud deployment and hosting
  • GitHub - Source code repository

πŸš€ Quick Start

Installation

<<<<<<< HEAD

  1. Clone the repository: git clone https://github.com/kdeepak2001/Ai-Text-Summarizer.git cd Ai-Text-Summarizer

  2. Create virtual environment: --- python -m venv .venv .venv\Scripts\activate # Windows source .venv/bin/activate # Linux/Mac ---

  3. Install dependencies: pip install -r requirements.txt


πŸ’‘ Usage

Web Interface (Streamlit)

streamlit run streamlit_app.py

1. Clone the repository: git clone https://github.com/kdeepak2001/Ai-Text-Summarizer.git cd Ai-Text-Summarizer

2. Create virtual environment: Windows python -m venv .venv .venv\Scripts\activate

Linux/Mac python3 -m venv .venv source .venv/bin/activate

3. Install dependencies: pip install -r requirements.txt


πŸ’‘ Usage

Web Interface (Streamlit)

streamlit run streamlit_app.py

4d37b71 (docs: update README with deployment section and complete JOURNEY) Then open http://localhost:8501 in your browser.

Command Line

From text input: <<<<<<< HEAD echo "Your text here..." | python app.py

echo "Your text here..." | python app.py

4d37b71 (docs: update README with deployment section and complete JOURNEY)

From file: python app.py --file document.txt --num-sentences 5

From URL: python app.py --url https://example.com/article


<<<<<<< HEAD

CLI Usage

=======

πŸ“‹ CLI Usage

Get help:

4d37b71 (docs: update README with deployment section and complete JOURNEY) $ python app.py --help usage: app.py [-h] [--file FILE] [--url URL] [--num-sentences N]

AI Text Summarizer - Extract key sentences from any text

<<<<<<< HEAD optional arguments: -h, --help show this help message and exit

optional arguments: -h, --help Show this help message and exit

4d37b71 (docs: update README with deployment section and complete JOURNEY) --file FILE, -f FILE Path to text file --url URL, -u URL URL to fetch and summarize --num-sentences N, -n N Number of sentences (default: 3) undefined



πŸ“‚ Project Structure

πŸ“‚ Project Structure

File/Folder Description
app.py CLI application for command-line usage
streamlit_app.py Web UI application with interactive interface
requirements.txt Python package dependencies
.streamlit/config.toml Streamlit configuration settings
README.md Project documentation
<<<<<<< HEAD
JOURNEY.md Development process log
LICENSE MIT License file

Key Directories:

  • Root - Main application files and configuration
  • .streamlit/ - Contains Streamlit-specific settings ======= | JOURNEY.md | Development process log with failures and learnings | | LICENSE | MIT License file |

Key Directories:

  • Root - Main application files and configuration
  • .streamlit/ - Contains Streamlit-specific settings

🌐 Deployment

Hugging Face Spaces

This application is deployed and live on Hugging Face Spaces - a free platform for hosting ML applications with Streamlit, Gradio, and other frameworks.

πŸ”— Live App: https://huggingface.co/spaces/deepak95026/ai-text-summarizer

Features of the deployed version:

  • βœ… No installation required - runs directly in browser
  • βœ… Always up-to-date with latest code from GitHub
  • βœ… Free hosting on Hugging Face infrastructure
  • βœ… Shareable link for portfolio, resume, and demos
  • βœ… Automatic rebuild on code updates
  • βœ… Accessible from any device with internet connection

How it's deployed:

  1. Connected GitHub repository to Hugging Face Spaces
  2. Configured README.md with Streamlit SDK settings (YAML frontmatter)
  3. Hugging Face automatically detects changes and rebuilds the app
  4. App runs on Streamlit server with production configuration

Configuration files for deployment:

  • README.md - Contains YAML frontmatter for Spaces configuration
  • .streamlit/config.toml - Streamlit-specific server settings
  • requirements.txt - Python dependencies for cloud environment

To deploy your own version:

  1. Fork this repository
  2. Create a new Space on Hugging Face
  3. Connect your GitHub repository
  4. Hugging Face will automatically deploy the app

4d37b71 (docs: update README with deployment section and complete JOURNEY)



πŸŽ“ Learning Outcomes

This project demonstrates proficiency in: <<<<<<< HEAD

  • βœ… Natural Language Processing fundamentals
  • βœ… Algorithm implementation (word frequency scoring)
  • βœ… Web application development with Streamlit
  • βœ… Command-line interface design with argparse
  • βœ… Web scraping with BeautifulSoup4
  • βœ… Git version control and GitHub workflow
  • βœ… Cloud deployment on Hugging Face Spaces
  • βœ… Professional documentation and code organization

=======

  • βœ… Natural Language Processing - Extractive summarization algorithms
  • βœ… Algorithm Development - Word frequency scoring implementation
  • βœ… Web Development - Streamlit framework and responsive UI
  • βœ… CLI Development - Command-line interface with argparse
  • βœ… Web Scraping - BeautifulSoup4 and HTTP requests with User-Agent management
  • βœ… Version Control - Git workflow and best practices
  • βœ… Cloud Deployment - Hugging Face Spaces deployment
  • βœ… Problem Solving - Debugging and iterative development
  • βœ… Documentation - Professional README and journey logging

πŸ“ Development Journey

This project was built over 4 days with multiple failures and learnings. Read the complete journey with honest documentation of struggles in JOURNEY.md.

Key challenges overcome:

  • Day 1: URL fetching and file upload feature failures
  • Day 2: API token synchronization issues
  • Day 3: Git history management with exposed secrets
  • Day 4: Successful deployment with simplified architecture

Total time invested: ~27 hours of development, debugging, and deployment

4d37b71 (docs: update README with deployment section and complete JOURNEY)


🀝 Contributing

Contributions are welcome! Feel free to:

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

Areas for contribution:

  • Additional summarization algorithms (abstractive, hybrid)
  • Multi-language support
  • PDF file upload support
  • Batch processing feature

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.



πŸ‘¨β€πŸ’» Author

K Deepak
πŸ”— LinkedIn | πŸ™ GitHub | πŸ“§ E-mail


πŸ™ Acknowledgments

  • AI Tools: ChatGPT, Perplexity, and Claude for development assistance
  • Frameworks: Streamlit for the beautiful UI framework
  • Hosting: Hugging Face for free Spaces deployment
  • Inspiration: NLP research in extractive text summarization

🌟 Future Enhancements

Planned features:

  • Multi-language support (Hindi, Spanish, French)
  • Abstractive summarization using transformers
  • PDF and DOCX file upload support
  • Batch processing for multiple documents
  • API endpoint for programmatic access
  • Summary quality metrics (ROUGE scores)
  • Dark mode toggle
  • Export summaries to PDF/TXT

πŸ“Š Performance Metrics

  • Accuracy: Extracts key sentences with high relevance
  • Speed: Summarizes 1000 words in < 1 second
  • Reduction: Achieves 95%+ text reduction
  • Scalability: Handles documents up to 50,000 words
  • Uptime: 99.9% on Hugging Face Spaces

⭐ If you found this project helpful, please consider giving it a star!


Built with ❀️ using Python and Streamlit | Deployed on Hugging Face Spaces

About

CLI tool for extracting key sentences using extractive summarization

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages