midlajvalappil commited on
Commit
53f4f5d
Β·
verified Β·
1 Parent(s): 8f09875

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +491 -5
README.md CHANGED
@@ -3,7 +3,8 @@ title: AI Note Summarizer
3
  emoji: πŸš€
4
  colorFrom: red
5
  colorTo: red
6
- sdk: docker
 
7
  app_port: 8501
8
  tags:
9
  - streamlit
@@ -12,9 +13,494 @@ short_description: Streamlit template space
12
  license: mit
13
  ---
14
 
15
- # Welcome to Streamlit!
16
 
17
- Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:
18
 
19
- If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
20
- forums](https://discuss.streamlit.io).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  emoji: πŸš€
4
  colorFrom: red
5
  colorTo: red
6
+ sdk: streamlit
7
+ app_file: src/streamlit_app.py
8
  app_port: 8501
9
  tags:
10
  - streamlit
 
13
  license: mit
14
  ---
15
 
16
+ # πŸ“ AI Notes Summarizer
17
 
18
+ <div align="center">
19
 
20
+ ![AI Notes Summarizer Logo](https://img.shields.io/badge/AI-Notes%20Summarizer-blue?style=for-the-badge&logo=artificial-intelligence)
21
+
22
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
23
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
24
+ [![Streamlit](https://img.shields.io/badge/Streamlit-FF4B4B?style=flat&logo=streamlit&logoColor=white)](https://streamlit.io/)
25
+ [![Docker](https://img.shields.io/badge/Docker-2496ED?style=flat&logo=docker&logoColor=white)](https://www.docker.com/)
26
+ [![Transformers](https://img.shields.io/badge/πŸ€—%20Transformers-FFD21E?style=flat)](https://huggingface.co/transformers/)
27
+
28
+ [![GitHub stars](https://img.shields.io/github/stars/midlaj-muhammed/AI-Note-Summarizer?style=social)](https://github.com/midlaj-muhammed/AI-Note-Summarizer/stargazers)
29
+ [![GitHub forks](https://img.shields.io/github/forks/midlaj-muhammed/AI-Note-Summarizer?style=social)](https://github.com/midlaj-muhammed/AI-Note-Summarizer/network/members)
30
+ [![GitHub issues](https://img.shields.io/github/issues/midlaj-muhammed/AI-Note-Summarizer)](https://github.com/midlaj-muhammed/AI-Note-Summarizer/issues)
31
+
32
+ </div>
33
+
34
+ A powerful web application that transforms lengthy documents and notes into concise, bullet-point summaries using state-of-the-art AI models.
35
+
36
+ ---
37
+
38
+ ## πŸ“‹ Table of Contents
39
+
40
+ - [✨ Features](#-features)
41
+ - [πŸš€ Quick Start](#-quick-start)
42
+ - [Option 1: Docker (Recommended)](#option-1-docker-recommended)
43
+ - [Option 2: Local Installation](#option-2-local-installation)
44
+ - [πŸ“– Usage Guide](#-usage-guide)
45
+ - [πŸ–ΌοΈ Screenshots](#️-screenshots)
46
+ - [πŸ› οΈ Technical Details](#️-technical-details)
47
+ - [🐳 Docker Deployment](#-docker-deployment)
48
+ - [πŸ”§ Configuration](#-configuration)
49
+ - [🚨 Troubleshooting](#-troubleshooting)
50
+ - [🀝 Contributing](#-contributing)
51
+ - [πŸ“„ License](#-license)
52
+ - [πŸ™ Acknowledgments](#-acknowledgments)
53
+ - [πŸ“ž Support](#-support)
54
+
55
+ ---
56
+
57
+ ## ✨ Features
58
+
59
+ - **PDF Processing**: Upload PDF files and extract text content automatically
60
+ - **Direct Text Input**: Paste text content directly for immediate summarization
61
+ - **AI-Powered Summarization**: Uses Hugging Face Transformers (BART, T5) for high-quality summaries
62
+ - **Bullet-Point Format**: Clean, readable bullet-point summaries
63
+ - **Multiple AI Models**: Choose from different pre-trained models
64
+ - **Customizable Length**: Adjust summary length (Short, Medium, Long)
65
+ - **Progress Tracking**: Real-time progress indicators during processing
66
+ - **Download Summaries**: Save generated summaries as text files
67
+ - **Statistics**: View compression ratios and word counts
68
+ - **Error Handling**: Comprehensive error handling and user feedback
69
+
70
+ ## πŸš€ Quick Start
71
+
72
+ ### Option 1: Docker (Recommended)
73
+
74
+ #### Prerequisites
75
+ - Docker and Docker Compose installed
76
+ - Internet connection (for downloading AI models)
77
+
78
+ #### Using Docker Compose (Easiest)
79
+ ```bash
80
+ # Clone the repository
81
+ git clone https://github.com/midlaj-muhammed/AI-Note-Summarizer.git
82
+ cd AI-Note-Summarizer
83
+
84
+ # Start the application
85
+ docker-compose up -d
86
+
87
+ # Access the application at http://localhost:8501
88
+ ```
89
+
90
+ #### Using Docker Scripts
91
+ ```bash
92
+ # Build the Docker image
93
+ ./docker-build.sh
94
+
95
+ # Run the container
96
+ ./docker-run.sh
97
+
98
+ # For development with live code reloading
99
+ ./docker-dev.sh
100
+ ```
101
+
102
+ #### Manual Docker Commands
103
+ ```bash
104
+ # Build the image
105
+ docker build -t ai-notes-summarizer .
106
+
107
+ # Run the container
108
+ docker run -p 8501:8501 ai-notes-summarizer
109
+ ```
110
+
111
+ ### Option 2: Local Installation
112
+
113
+ #### Prerequisites
114
+ - Python 3.8 or higher
115
+ - pip (Python package installer)
116
+ - Internet connection (for downloading AI models)
117
+
118
+ #### Installation Steps
119
+ 1. **Clone the repository**
120
+ ```bash
121
+ git clone https://github.com/midlaj-muhammed/AI-Note-Summarizer.git
122
+ cd AI-Note-Summarizer
123
+ ```
124
+
125
+ 2. **Install dependencies**
126
+ ```bash
127
+ pip install -r requirements.txt
128
+ ```
129
+
130
+ 3. **Run the application**
131
+ ```bash
132
+ streamlit run app.py
133
+ ```
134
+
135
+ 4. **Open your browser**
136
+ - The application will automatically open at `http://localhost:8501`
137
+ - If it doesn't open automatically, navigate to the URL manually
138
+
139
+ ## πŸ“– Usage Guide
140
+
141
+ ### PDF Summarization
142
+
143
+ 1. **Upload PDF**: Click on the "πŸ“„ PDF Upload" tab
144
+ 2. **Select File**: Choose a PDF file (max 10MB)
145
+ 3. **Process**: Click "πŸ“– Extract & Summarize PDF"
146
+ 4. **Review**: View the extracted text preview
147
+ 5. **Get Summary**: The AI will generate a bullet-point summary
148
+ 6. **Download**: Save the summary using the download button
149
+
150
+ ### Text Summarization
151
+
152
+ 1. **Input Text**: Click on the "πŸ“ Text Input" tab
153
+ 2. **Paste Content**: Enter or paste your text (minimum 100 characters)
154
+ 3. **Summarize**: Click "πŸš€ Summarize Text"
155
+ 4. **Review**: View the generated summary
156
+ 5. **Download**: Save the summary as needed
157
+
158
+ ### Settings
159
+
160
+ - **AI Model**: Choose from BART (recommended), T5, or DistilBART
161
+ - **Summary Length**: Select Short, Medium, or Long summaries
162
+ - **Statistics**: View word counts and compression ratios
163
+
164
+ ## πŸ› οΈ Technical Details
165
+
166
+ ### Architecture
167
+
168
+ ```
169
+ ai-notes-summarizer/
170
+ β”œβ”€β”€ app.py # Main Streamlit application
171
+ β”œβ”€β”€ modules/
172
+ β”‚ β”œβ”€β”€ __init__.py
173
+ β”‚ β”œβ”€β”€ pdf_processor.py # PDF text extraction
174
+ β”‚ β”œβ”€β”€ text_summarizer.py # AI summarization
175
+ β”‚ └── utils.py # Utility functions
176
+ β”œβ”€β”€ requirements.txt # Python dependencies
177
+ └── README.md # This file
178
+ ```
179
+
180
+ ### AI Models
181
+
182
+ - **BART (facebook/bart-large-cnn)**: Best quality, recommended for most use cases
183
+ - **T5 Small**: Faster processing, good for shorter texts
184
+ - **DistilBART**: Balanced performance and speed
185
+
186
+ ### Dependencies
187
+
188
+ - **Streamlit**: Web application framework
189
+ - **Transformers**: Hugging Face AI models
190
+ - **PyTorch**: Deep learning framework
191
+ - **PyPDF2**: PDF text extraction
192
+ - **Additional utilities**: See `requirements.txt`
193
+
194
+ ## πŸ”§ Configuration
195
+
196
+ ### Model Selection
197
+
198
+ You can change the default model by modifying the `TextSummarizer` initialization in `app.py`:
199
+
200
+ ```python
201
+ text_summarizer = TextSummarizer(model_name="your-preferred-model")
202
+ ```
203
+
204
+ ### Summary Length
205
+
206
+ Adjust default summary lengths in `modules/text_summarizer.py`:
207
+
208
+ ```python
209
+ self.min_summary_length = 50 # Minimum words
210
+ self.max_summary_length = 300 # Maximum words
211
+ ```
212
+
213
+ ### File Size Limits
214
+
215
+ Modify PDF file size limits in `modules/pdf_processor.py`:
216
+
217
+ ```python
218
+ self.max_file_size = 10 * 1024 * 1024 # 10MB
219
+ ```
220
+
221
+ ## 🚨 Troubleshooting
222
+
223
+ ### Common Issues
224
+
225
+ 1. **Model Loading Errors**
226
+ - Ensure stable internet connection
227
+ - Check available disk space (models can be 1-2GB)
228
+ - Try switching to a smaller model (T5 Small or DistilBART)
229
+
230
+ 2. **PDF Processing Issues**
231
+ - Ensure PDF is not encrypted
232
+ - Check if PDF contains readable text (not just images)
233
+ - Try with a smaller PDF file
234
+
235
+ 3. **Memory Errors**
236
+ - Reduce text length
237
+ - Close other applications
238
+ - Try using CPU instead of GPU
239
+
240
+ 4. **Slow Performance**
241
+ - Use GPU if available
242
+ - Choose smaller models for faster processing
243
+ - Process shorter text chunks
244
+
245
+ ### Error Messages
246
+
247
+ - **"Text is too short"**: Minimum 100 characters required
248
+ - **"No readable text found"**: PDF may contain only images
249
+ - **"Model loading error"**: Check internet connection
250
+ - **"Out of memory"**: Reduce text length or restart application
251
+
252
+ ## 🎯 Best Practices
253
+
254
+ ### For Best Results
255
+
256
+ 1. **Text Quality**: Use well-formatted, coherent text
257
+ 2. **Length**: Optimal text length is 500-5000 words
258
+ 3. **Content**: Works best with structured content (articles, reports, notes)
259
+ 4. **Model Choice**: Use BART for academic/formal content, T5 for general text
260
+
261
+ ### Performance Tips
262
+
263
+ 1. **GPU Usage**: Enable CUDA for faster processing
264
+ 2. **Batch Processing**: Process multiple documents separately
265
+ 3. **Model Caching**: Models are cached after first load
266
+ 4. **Text Preprocessing**: Clean text improves summary quality
267
+
268
+ ## πŸ–ΌοΈ Screenshots
269
+
270
+ <div align="center">
271
+
272
+ ### Main Interface
273
+ ![Main Interface](https://via.placeholder.com/800x500/1f2937/ffffff?text=AI+Notes+Summarizer+Main+Interface)
274
+ *Clean and intuitive interface with PDF upload and text input options*
275
+
276
+ ### PDF Processing
277
+ ![PDF Processing](https://via.placeholder.com/800x500/3b82f6/ffffff?text=PDF+Processing+in+Action)
278
+ *Real-time PDF processing with progress indicators*
279
+
280
+ ### Summary Results
281
+ ![Summary Results](https://via.placeholder.com/800x500/10b981/ffffff?text=Generated+Summary+Results)
282
+ *Bullet-point summaries with statistics and download options*
283
+
284
+ ### Settings Panel
285
+ ![Settings Panel](https://via.placeholder.com/800x500/8b5cf6/ffffff?text=AI+Model+Settings+%26+Configuration)
286
+ *Customizable AI model selection and summary length options*
287
+
288
+ </div>
289
+
290
+ > **Note**: Screenshots are placeholders. Actual screenshots will be added once the application is deployed.
291
+
292
+ ## πŸŽ₯ Demo
293
+
294
+ πŸš€ **[Live Demo](https://your-demo-url.com)** (Coming Soon)
295
+
296
+ πŸ“Ή **Demo Video**: [Watch on YouTube](https://youtube.com/placeholder) (Coming Soon)
297
+
298
+ ## πŸ“„ License
299
+
300
+ This project is open source and available under the MIT License.
301
+
302
+ ## 🀝 Contributing
303
+
304
+ Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
305
+
306
+ ## 🐳 Docker Deployment
307
+
308
+ ### Production Deployment
309
+
310
+ For production deployment, use the standard Docker Compose configuration:
311
+
312
+ ```bash
313
+ # Start in production mode
314
+ docker-compose up -d
315
+
316
+ # View logs
317
+ docker-compose logs -f
318
+
319
+ # Stop the application
320
+ docker-compose down
321
+
322
+ # Update the application
323
+ docker-compose pull
324
+ docker-compose up -d
325
+ ```
326
+
327
+ ### Development Mode
328
+
329
+ For development with live code reloading:
330
+
331
+ ```bash
332
+ # Start development environment
333
+ docker-compose -f docker-compose.dev.yml up
334
+
335
+ # Or use the convenience script
336
+ ./docker-dev.sh
337
+ ```
338
+
339
+ ### Docker Configuration
340
+
341
+ #### Environment Variables
342
+ - `STREAMLIT_SERVER_PORT`: Port for the application (default: 8501)
343
+ - `TRANSFORMERS_CACHE`: Cache directory for AI models
344
+ - `MAX_FILE_SIZE_MB`: Maximum PDF file size (default: 10MB)
345
+
346
+ #### Volumes
347
+ - `model_cache`: Persistent storage for downloaded AI models
348
+ - `logs`: Application logs
349
+ - `uploads`: Temporary file storage (optional)
350
+
351
+ #### Resource Limits
352
+ - Memory: 4GB limit, 2GB reserved
353
+ - CPU: 2 cores limit, 1 core reserved
354
+
355
+ ### Docker Troubleshooting
356
+
357
+ 1. **Container won't start**: Check logs with `docker-compose logs`
358
+ 2. **Out of memory**: Increase Docker memory limits
359
+ 3. **Model download fails**: Ensure internet connectivity
360
+ 4. **Permission issues**: Check file ownership and Docker user settings
361
+
362
+ ## 🀝 Contributing
363
+
364
+ We welcome contributions from the community! Here's how you can help:
365
+
366
+ ### 🌟 Ways to Contribute
367
+
368
+ - ⭐ **Star this repository** if you find it useful
369
+ - πŸ› **Report bugs** by opening an [issue](https://github.com/midlaj-muhammed/AI-Note-Summarizer/issues)
370
+ - πŸ’‘ **Suggest features** or improvements
371
+ - πŸ“– **Improve documentation**
372
+ - πŸ”§ **Submit pull requests** with bug fixes or new features
373
+
374
+ ### πŸš€ Getting Started
375
+
376
+ 1. **Fork the repository**
377
+ ```bash
378
+ # Click the "Fork" button on GitHub, then:
379
+ git clone https://github.com/YOUR-USERNAME/AI-Note-Summarizer.git
380
+ cd AI-Note-Summarizer
381
+ ```
382
+
383
+ 2. **Create a feature branch**
384
+ ```bash
385
+ git checkout -b feature/amazing-feature
386
+ ```
387
+
388
+ 3. **Make your changes**
389
+ - Follow the existing code style
390
+ - Add tests for new features
391
+ - Update documentation as needed
392
+
393
+ 4. **Test your changes**
394
+ ```bash
395
+ # Run basic tests
396
+ python test_basic.py
397
+
398
+ # Test Docker build
399
+ ./docker-test.sh
400
+ ```
401
+
402
+ 5. **Submit a pull request**
403
+ ```bash
404
+ git add .
405
+ git commit -m "Add amazing feature"
406
+ git push origin feature/amazing-feature
407
+ ```
408
+
409
+ ### πŸ“‹ Development Guidelines
410
+
411
+ - **Code Style**: Follow PEP 8 for Python code
412
+ - **Documentation**: Update README.md for new features
413
+ - **Testing**: Add tests for new functionality
414
+ - **Docker**: Ensure Docker compatibility
415
+ - **Dependencies**: Keep requirements.txt updated
416
+
417
+ ### πŸ› Reporting Issues
418
+
419
+ When reporting issues, please include:
420
+
421
+ - **Environment details** (OS, Python version, Docker version)
422
+ - **Steps to reproduce** the issue
423
+ - **Expected vs actual behavior**
424
+ - **Error messages** or logs
425
+ - **Screenshots** if applicable
426
+
427
+ [**Report an Issue β†’**](https://github.com/midlaj-muhammed/AI-Note-Summarizer/issues/new)
428
+
429
+ ### πŸ’¬ Discussions
430
+
431
+ Join our community discussions:
432
+
433
+ - [**GitHub Discussions**](https://github.com/midlaj-muhammed/AI-Note-Summarizer/discussions) - General questions and ideas
434
+ - [**Issues**](https://github.com/midlaj-muhammed/AI-Note-Summarizer/issues) - Bug reports and feature requests
435
+
436
+ ## πŸ“„ License
437
+
438
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
439
+
440
+ ## πŸ™ Acknowledgments
441
+
442
+ ### πŸ› οΈ Built With
443
+
444
+ - [**Streamlit**](https://streamlit.io/) - Web application framework
445
+ - [**Hugging Face Transformers**](https://huggingface.co/transformers/) - AI/ML models
446
+ - [**PyTorch**](https://pytorch.org/) - Deep learning framework
447
+ - [**PyPDF2**](https://pypdf2.readthedocs.io/) - PDF processing
448
+ - [**Docker**](https://www.docker.com/) - Containerization
449
+
450
+ ### 🎯 Inspiration
451
+
452
+ - Inspired by the need for efficient document summarization
453
+ - Built to help students, researchers, and professionals save time
454
+ - Leverages state-of-the-art AI models for high-quality summaries
455
+
456
+ ### πŸ€– AI Models
457
+
458
+ Special thanks to the teams behind these amazing models:
459
+ - [**BART**](https://huggingface.co/facebook/bart-large-cnn) by Facebook AI
460
+ - [**T5**](https://huggingface.co/t5-small) by Google Research
461
+ - [**DistilBART**](https://huggingface.co/sshleifer/distilbart-cnn-12-6) by Sam Shleifer
462
+
463
+ ### πŸ‘₯ Contributors
464
+
465
+ Thanks to all contributors who have helped improve this project!
466
+
467
+ [![Contributors](https://contrib.rocks/image?repo=midlaj-muhammed/AI-Note-Summarizer)](https://github.com/midlaj-muhammed/AI-Note-Summarizer/graphs/contributors)
468
+
469
+ ## πŸ“ž Support
470
+
471
+ If you encounter any issues or have questions:
472
+
473
+ ### πŸ” Self-Help Resources
474
+
475
+ 1. πŸ“– Check the [troubleshooting section](#-troubleshooting) above
476
+ 2. πŸ› Review error messages for specific guidance
477
+ 3. πŸ“¦ Ensure all dependencies are properly installed
478
+ 4. πŸ”„ Try with different models or settings
479
+ 5. 🐳 For Docker issues, check container logs: `docker-compose logs`
480
+
481
+ ### πŸ’¬ Get Help
482
+
483
+ - πŸ› **Bug Reports**: [Open an Issue](https://github.com/midlaj-muhammed/AI-Note-Summarizer/issues/new)
484
+ - πŸ’‘ **Feature Requests**: [Start a Discussion](https://github.com/midlaj-muhammed/AI-Note-Summarizer/discussions)
485
+ - πŸ“§ **Direct Contact**: [Email the maintainer](mailto:midlaj.muhammed@example.com)
486
+
487
+ ### 🌟 Show Your Support
488
+
489
+ If this project helped you, please consider:
490
+
491
+ - ⭐ **Starring the repository**
492
+ - 🍴 **Forking and contributing**
493
+ - πŸ“’ **Sharing with others**
494
+ - πŸ’ **Sponsoring the project** (Coming Soon)
495
+
496
+ ---
497
+
498
+ <div align="center">
499
+
500
+ **Made with ❀️ by [Muhammed Midlaj](https://github.com/midlaj-muhammed)**
501
+
502
+ **Happy Summarizing! πŸ“βœ¨**
503
+
504
+ [![GitHub](https://img.shields.io/badge/GitHub-midlaj--muhammed-181717?style=flat&logo=github)](https://github.com/midlaj-muhammed)
505
+
506
+ </div>