Spaces:
Sleeping
A newer version of the Streamlit SDK is available:
1.55.0
title: AI Note Summarizer
emoji: π
colorFrom: red
colorTo: red
sdk: streamlit
app_file: src/streamlit_app.py
app_port: 8501
tags:
- streamlit
pinned: false
short_description: Streamlit template space
license: mit
π AI Notes Summarizer
A powerful web application that transforms lengthy documents and notes into concise, bullet-point summaries using state-of-the-art AI models.
π Table of Contents
- β¨ Features
- π Quick Start
- π Usage Guide
- πΌοΈ Screenshots
- π οΈ Technical Details
- π³ Docker Deployment
- π§ Configuration
- π¨ Troubleshooting
- π€ Contributing
- π License
- π Acknowledgments
- π Support
β¨ Features
- PDF Processing: Upload PDF files and extract text content automatically
- Direct Text Input: Paste text content directly for immediate summarization
- AI-Powered Summarization: Uses Hugging Face Transformers (BART, T5) for high-quality summaries
- Bullet-Point Format: Clean, readable bullet-point summaries
- Multiple AI Models: Choose from different pre-trained models
- Customizable Length: Adjust summary length (Short, Medium, Long)
- Progress Tracking: Real-time progress indicators during processing
- Download Summaries: Save generated summaries as text files
- Statistics: View compression ratios and word counts
- Error Handling: Comprehensive error handling and user feedback
π Quick Start
Option 1: Docker (Recommended)
Prerequisites
- Docker and Docker Compose installed
- Internet connection (for downloading AI models)
Using Docker Compose (Easiest)
# Clone the repository
git clone https://github.com/midlaj-muhammed/AI-Note-Summarizer.git
cd AI-Note-Summarizer
# Start the application
docker-compose up -d
# Access the application at http://localhost:8501
Using Docker Scripts
# Build the Docker image
./docker-build.sh
# Run the container
./docker-run.sh
# For development with live code reloading
./docker-dev.sh
Manual Docker Commands
# Build the image
docker build -t ai-notes-summarizer .
# Run the container
docker run -p 8501:8501 ai-notes-summarizer
Option 2: Local Installation
Prerequisites
- Python 3.8 or higher
- pip (Python package installer)
- Internet connection (for downloading AI models)
Installation Steps
Clone the repository
git clone https://github.com/midlaj-muhammed/AI-Note-Summarizer.git cd AI-Note-SummarizerInstall dependencies
pip install -r requirements.txtRun the application
streamlit run app.pyOpen your browser
- The application will automatically open at
http://localhost:8501 - If it doesn't open automatically, navigate to the URL manually
- The application will automatically open at
π Usage Guide
PDF Summarization
- Upload PDF: Click on the "π PDF Upload" tab
- Select File: Choose a PDF file (max 10MB)
- Process: Click "π Extract & Summarize PDF"
- Review: View the extracted text preview
- Get Summary: The AI will generate a bullet-point summary
- Download: Save the summary using the download button
Text Summarization
- Input Text: Click on the "π Text Input" tab
- Paste Content: Enter or paste your text (minimum 100 characters)
- Summarize: Click "π Summarize Text"
- Review: View the generated summary
- Download: Save the summary as needed
Settings
- AI Model: Choose from BART (recommended), T5, or DistilBART
- Summary Length: Select Short, Medium, or Long summaries
- Statistics: View word counts and compression ratios
π οΈ Technical Details
Architecture
ai-notes-summarizer/
βββ app.py # Main Streamlit application
βββ modules/
β βββ __init__.py
β βββ pdf_processor.py # PDF text extraction
β βββ text_summarizer.py # AI summarization
β βββ utils.py # Utility functions
βββ requirements.txt # Python dependencies
βββ README.md # This file
AI Models
- BART (facebook/bart-large-cnn): Best quality, recommended for most use cases
- T5 Small: Faster processing, good for shorter texts
- DistilBART: Balanced performance and speed
Dependencies
- Streamlit: Web application framework
- Transformers: Hugging Face AI models
- PyTorch: Deep learning framework
- PyPDF2: PDF text extraction
- Additional utilities: See
requirements.txt
π§ Configuration
Model Selection
You can change the default model by modifying the TextSummarizer initialization in app.py:
text_summarizer = TextSummarizer(model_name="your-preferred-model")
Summary Length
Adjust default summary lengths in modules/text_summarizer.py:
self.min_summary_length = 50 # Minimum words
self.max_summary_length = 300 # Maximum words
File Size Limits
Modify PDF file size limits in modules/pdf_processor.py:
self.max_file_size = 10 * 1024 * 1024 # 10MB
π¨ Troubleshooting
Common Issues
Model Loading Errors
- Ensure stable internet connection
- Check available disk space (models can be 1-2GB)
- Try switching to a smaller model (T5 Small or DistilBART)
PDF Processing Issues
- Ensure PDF is not encrypted
- Check if PDF contains readable text (not just images)
- Try with a smaller PDF file
Memory Errors
- Reduce text length
- Close other applications
- Try using CPU instead of GPU
Slow Performance
- Use GPU if available
- Choose smaller models for faster processing
- Process shorter text chunks
Error Messages
- "Text is too short": Minimum 100 characters required
- "No readable text found": PDF may contain only images
- "Model loading error": Check internet connection
- "Out of memory": Reduce text length or restart application
π― Best Practices
For Best Results
- Text Quality: Use well-formatted, coherent text
- Length: Optimal text length is 500-5000 words
- Content: Works best with structured content (articles, reports, notes)
- Model Choice: Use BART for academic/formal content, T5 for general text
Performance Tips
- GPU Usage: Enable CUDA for faster processing
- Batch Processing: Process multiple documents separately
- Model Caching: Models are cached after first load
- Text Preprocessing: Clean text improves summary quality
πΌοΈ Screenshots
Main Interface
Clean and intuitive interface with PDF upload and text input options
PDF Processing
Real-time PDF processing with progress indicators
Summary Results
Bullet-point summaries with statistics and download options
Settings Panel
Note: Screenshots are placeholders. Actual screenshots will be added once the application is deployed.
π₯ Demo
π Live Demo (Coming Soon)
πΉ Demo Video: Watch on YouTube (Coming Soon)
π License
This project is open source and available under the MIT License.
π€ Contributing
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
π³ Docker Deployment
Production Deployment
For production deployment, use the standard Docker Compose configuration:
# Start in production mode
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the application
docker-compose down
# Update the application
docker-compose pull
docker-compose up -d
Development Mode
For development with live code reloading:
# Start development environment
docker-compose -f docker-compose.dev.yml up
# Or use the convenience script
./docker-dev.sh
Docker Configuration
Environment Variables
STREAMLIT_SERVER_PORT: Port for the application (default: 8501)TRANSFORMERS_CACHE: Cache directory for AI modelsMAX_FILE_SIZE_MB: Maximum PDF file size (default: 10MB)
Volumes
model_cache: Persistent storage for downloaded AI modelslogs: Application logsuploads: Temporary file storage (optional)
Resource Limits
- Memory: 4GB limit, 2GB reserved
- CPU: 2 cores limit, 1 core reserved
Docker Troubleshooting
- Container won't start: Check logs with
docker-compose logs - Out of memory: Increase Docker memory limits
- Model download fails: Ensure internet connectivity
- Permission issues: Check file ownership and Docker user settings
π€ Contributing
We welcome contributions from the community! Here's how you can help:
π Ways to Contribute
- β Star this repository if you find it useful
- π Report bugs by opening an issue
- π‘ Suggest features or improvements
- π Improve documentation
- π§ Submit pull requests with bug fixes or new features
π Getting Started
Fork the repository
# Click the "Fork" button on GitHub, then: git clone https://github.com/YOUR-USERNAME/AI-Note-Summarizer.git cd AI-Note-SummarizerCreate a feature branch
git checkout -b feature/amazing-featureMake your changes
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
Test your changes
# Run basic tests python test_basic.py # Test Docker build ./docker-test.shSubmit a pull request
git add . git commit -m "Add amazing feature" git push origin feature/amazing-feature
π Development Guidelines
- Code Style: Follow PEP 8 for Python code
- Documentation: Update README.md for new features
- Testing: Add tests for new functionality
- Docker: Ensure Docker compatibility
- Dependencies: Keep requirements.txt updated
π Reporting Issues
When reporting issues, please include:
- Environment details (OS, Python version, Docker version)
- Steps to reproduce the issue
- Expected vs actual behavior
- Error messages or logs
- Screenshots if applicable
π¬ Discussions
Join our community discussions:
- GitHub Discussions - General questions and ideas
- Issues - Bug reports and feature requests
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
π οΈ Built With
- Streamlit - Web application framework
- Hugging Face Transformers - AI/ML models
- PyTorch - Deep learning framework
- PyPDF2 - PDF processing
- Docker - Containerization
π― Inspiration
- Inspired by the need for efficient document summarization
- Built to help students, researchers, and professionals save time
- Leverages state-of-the-art AI models for high-quality summaries
π€ AI Models
Special thanks to the teams behind these amazing models:
- BART by Facebook AI
- T5 by Google Research
- DistilBART by Sam Shleifer
π₯ Contributors
Thanks to all contributors who have helped improve this project!
π Support
If you encounter any issues or have questions:
π Self-Help Resources
- π Check the troubleshooting section above
- π Review error messages for specific guidance
- π¦ Ensure all dependencies are properly installed
- π Try with different models or settings
- π³ For Docker issues, check container logs:
docker-compose logs
π¬ Get Help
- π Bug Reports: Open an Issue
- π‘ Feature Requests: Start a Discussion
- π§ Direct Contact: Email the maintainer
π Show Your Support
If this project helped you, please consider:
- β Starring the repository
- π΄ Forking and contributing
- π’ Sharing with others
- π Sponsoring the project (Coming Soon)