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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
---
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

<div align="center">

![AI Notes Summarizer Logo](https://img.shields.io/badge/AI-Notes%20Summarizer-blue?style=for-the-badge&logo=artificial-intelligence)

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![Streamlit](https://img.shields.io/badge/Streamlit-FF4B4B?style=flat&logo=streamlit&logoColor=white)](https://streamlit.io/)
[![Docker](https://img.shields.io/badge/Docker-2496ED?style=flat&logo=docker&logoColor=white)](https://www.docker.com/)
[![Transformers](https://img.shields.io/badge/πŸ€—%20Transformers-FFD21E?style=flat)](https://huggingface.co/transformers/)

[![GitHub stars](https://img.shields.io/github/stars/midlaj-muhammed/AI-Note-Summarizer?style=social)](https://github.com/midlaj-muhammed/AI-Note-Summarizer/stargazers)
[![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)
[![GitHub issues](https://img.shields.io/github/issues/midlaj-muhammed/AI-Note-Summarizer)](https://github.com/midlaj-muhammed/AI-Note-Summarizer/issues)

</div>

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](#-features)
- [πŸš€ Quick Start](#-quick-start)
  - [Option 1: Docker (Recommended)](#option-1-docker-recommended)
  - [Option 2: Local Installation](#option-2-local-installation)
- [πŸ“– Usage Guide](#-usage-guide)
- [πŸ–ΌοΈ Screenshots](#️-screenshots)
- [πŸ› οΈ Technical Details](#️-technical-details)
- [🐳 Docker Deployment](#-docker-deployment)
- [πŸ”§ Configuration](#-configuration)
- [🚨 Troubleshooting](#-troubleshooting)
- [🀝 Contributing](#-contributing)
- [πŸ“„ License](#-license)
- [πŸ™ Acknowledgments](#-acknowledgments)
- [πŸ“ž Support](#-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)
```bash
# 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
```bash
# 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
```bash
# 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
1. **Clone the repository**
   ```bash
   git clone https://github.com/midlaj-muhammed/AI-Note-Summarizer.git
   cd AI-Note-Summarizer
   ```

2. **Install dependencies**
   ```bash
   pip install -r requirements.txt
   ```

3. **Run the application**
   ```bash
   streamlit run app.py
   ```

4. **Open your browser**
   - The application will automatically open at `http://localhost:8501`
   - If it doesn't open automatically, navigate to the URL manually

## πŸ“– Usage Guide

### PDF Summarization

1. **Upload PDF**: Click on the "πŸ“„ PDF Upload" tab
2. **Select File**: Choose a PDF file (max 10MB)
3. **Process**: Click "πŸ“– Extract & Summarize PDF"
4. **Review**: View the extracted text preview
5. **Get Summary**: The AI will generate a bullet-point summary
6. **Download**: Save the summary using the download button

### Text Summarization

1. **Input Text**: Click on the "πŸ“ Text Input" tab
2. **Paste Content**: Enter or paste your text (minimum 100 characters)
3. **Summarize**: Click "πŸš€ Summarize Text"
4. **Review**: View the generated summary
5. **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`:

```python
text_summarizer = TextSummarizer(model_name="your-preferred-model")
```

### Summary Length

Adjust default summary lengths in `modules/text_summarizer.py`:

```python
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`:

```python
self.max_file_size = 10 * 1024 * 1024  # 10MB
```

## 🚨 Troubleshooting

### Common Issues

1. **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)

2. **PDF Processing Issues**
   - Ensure PDF is not encrypted
   - Check if PDF contains readable text (not just images)
   - Try with a smaller PDF file

3. **Memory Errors**
   - Reduce text length
   - Close other applications
   - Try using CPU instead of GPU

4. **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

1. **Text Quality**: Use well-formatted, coherent text
2. **Length**: Optimal text length is 500-5000 words
3. **Content**: Works best with structured content (articles, reports, notes)
4. **Model Choice**: Use BART for academic/formal content, T5 for general text

### Performance Tips

1. **GPU Usage**: Enable CUDA for faster processing
2. **Batch Processing**: Process multiple documents separately
3. **Model Caching**: Models are cached after first load
4. **Text Preprocessing**: Clean text improves summary quality

## πŸ–ΌοΈ Screenshots

<div align="center">

### Main Interface
![Main Interface](https://via.placeholder.com/800x500/1f2937/ffffff?text=AI+Notes+Summarizer+Main+Interface)
*Clean and intuitive interface with PDF upload and text input options*

### PDF Processing
![PDF Processing](https://via.placeholder.com/800x500/3b82f6/ffffff?text=PDF+Processing+in+Action)
*Real-time PDF processing with progress indicators*

### Summary Results
![Summary Results](https://via.placeholder.com/800x500/10b981/ffffff?text=Generated+Summary+Results)
*Bullet-point summaries with statistics and download options*

### Settings Panel
![Settings Panel](https://via.placeholder.com/800x500/8b5cf6/ffffff?text=AI+Model+Settings+%26+Configuration)
*Customizable AI model selection and summary length options*

</div>

> **Note**: Screenshots are placeholders. Actual screenshots will be added once the application is deployed.

## πŸŽ₯ Demo

πŸš€ **[Live Demo](https://your-demo-url.com)** (Coming Soon)

πŸ“Ή **Demo Video**: [Watch on YouTube](https://youtube.com/placeholder) (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:

```bash
# 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:

```bash
# 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 models
- `MAX_FILE_SIZE_MB`: Maximum PDF file size (default: 10MB)

#### Volumes
- `model_cache`: Persistent storage for downloaded AI models
- `logs`: Application logs
- `uploads`: Temporary file storage (optional)

#### Resource Limits
- Memory: 4GB limit, 2GB reserved
- CPU: 2 cores limit, 1 core reserved

### Docker Troubleshooting

1. **Container won't start**: Check logs with `docker-compose logs`
2. **Out of memory**: Increase Docker memory limits
3. **Model download fails**: Ensure internet connectivity
4. **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](https://github.com/midlaj-muhammed/AI-Note-Summarizer/issues)
- πŸ’‘ **Suggest features** or improvements
- πŸ“– **Improve documentation**
- πŸ”§ **Submit pull requests** with bug fixes or new features

### πŸš€ Getting Started

1. **Fork the repository**
   ```bash
   # Click the "Fork" button on GitHub, then:
   git clone https://github.com/YOUR-USERNAME/AI-Note-Summarizer.git
   cd AI-Note-Summarizer
   ```

2. **Create a feature branch**
   ```bash
   git checkout -b feature/amazing-feature
   ```

3. **Make your changes**
   - Follow the existing code style
   - Add tests for new features
   - Update documentation as needed

4. **Test your changes**
   ```bash
   # Run basic tests
   python test_basic.py

   # Test Docker build
   ./docker-test.sh
   ```

5. **Submit a pull request**
   ```bash
   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

[**Report an Issue β†’**](https://github.com/midlaj-muhammed/AI-Note-Summarizer/issues/new)

### πŸ’¬ Discussions

Join our community discussions:

- [**GitHub Discussions**](https://github.com/midlaj-muhammed/AI-Note-Summarizer/discussions) - General questions and ideas
- [**Issues**](https://github.com/midlaj-muhammed/AI-Note-Summarizer/issues) - Bug reports and feature requests

## πŸ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## πŸ™ Acknowledgments

### πŸ› οΈ Built With

- [**Streamlit**](https://streamlit.io/) - Web application framework
- [**Hugging Face Transformers**](https://huggingface.co/transformers/) - AI/ML models
- [**PyTorch**](https://pytorch.org/) - Deep learning framework
- [**PyPDF2**](https://pypdf2.readthedocs.io/) - PDF processing
- [**Docker**](https://www.docker.com/) - 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**](https://huggingface.co/facebook/bart-large-cnn) by Facebook AI
- [**T5**](https://huggingface.co/t5-small) by Google Research
- [**DistilBART**](https://huggingface.co/sshleifer/distilbart-cnn-12-6) by Sam Shleifer

### πŸ‘₯ Contributors

Thanks to all contributors who have helped improve this project!

[![Contributors](https://contrib.rocks/image?repo=midlaj-muhammed/AI-Note-Summarizer)](https://github.com/midlaj-muhammed/AI-Note-Summarizer/graphs/contributors)

## πŸ“ž Support

If you encounter any issues or have questions:

### πŸ” Self-Help Resources

1. πŸ“– Check the [troubleshooting section](#-troubleshooting) above
2. πŸ› Review error messages for specific guidance
3. πŸ“¦ Ensure all dependencies are properly installed
4. πŸ”„ Try with different models or settings
5. 🐳 For Docker issues, check container logs: `docker-compose logs`

### πŸ’¬ Get Help

- πŸ› **Bug Reports**: [Open an Issue](https://github.com/midlaj-muhammed/AI-Note-Summarizer/issues/new)
- πŸ’‘ **Feature Requests**: [Start a Discussion](https://github.com/midlaj-muhammed/AI-Note-Summarizer/discussions)
- πŸ“§ **Direct Contact**: [Email the maintainer](mailto:midlaj.muhammed@example.com)

### 🌟 Show Your Support

If this project helped you, please consider:

- ⭐ **Starring the repository**
- 🍴 **Forking and contributing**
- πŸ“’ **Sharing with others**
- πŸ’ **Sponsoring the project** (Coming Soon)

---

<div align="center">

**Made with ❀️ by [Muhammed Midlaj](https://github.com/midlaj-muhammed)**

**Happy Summarizing! πŸ“βœ¨**

[![GitHub](https://img.shields.io/badge/GitHub-midlaj--muhammed-181717?style=flat&logo=github)](https://github.com/midlaj-muhammed)

</div>