A modern web application that allows users to upload documents and get intelligent analysis using AI. Built with Flask, Python, and Ollama for local AI processing.
- π Multi-format Support: Handle TXT, PDF, DOCX, XLSX, and CSV files
- π€ AI-Powered Analysis: Uses Ollama for intelligent document processing
- π Privacy-First: All processing done locally, files deleted after analysis
- β‘ Fast Processing: Quick analysis with immediate results
- π¨ Modern UI: Clean, responsive interface with beautiful styling
- π± Mobile Friendly: Works seamlessly on desktop and mobile devices
- Python 3.7 or higher
- Ollama installed and running
-
Clone the repository
git clone https://github.com/evaibhav/Ai-File-Analyzer.git cd Ai-File-Analyzer -
Create virtual environment
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Install and setup Ollama
- Download from ollama.ai
- Install for your operating system
- Pull a model (e.g., llama2):
ollama pull llama2
-
Run the application
# Start Ollama service (in one terminal) ollama serve # Start the Flask app (in another terminal) python app.py
-
Open your browser Navigate to
http://localhost:5000
file-analyzer/
βββ app.py # Main Flask application
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
βββ uploads/ # Temporary file storage
βββ templates/
β βββ index.html # Main HTML template
βββ static/
βββ style.css # CSS styling
- Upload a File: Choose from supported formats (TXT, PDF, DOCX, XLSX, CSV)
- Enter Analysis Prompt: Describe what you want to analyze
- Get Results: Receive AI-powered analysis instantly
- "Summarize the main points of this document"
- "Extract key insights and recommendations"
- "Analyze the sentiment and tone"
- "Find important data patterns and trends"
- "What are the key takeaways?"
- "Identify action items and next steps"
- Backend: Flask (Python web framework)
- AI Processing: Ollama (Local AI model runner)
- Frontend: HTML5, CSS3, JavaScript
- File Processing: PyPDF2, python-docx, pandas, openpyxl
| Format | Extension | Description |
|---|---|---|
| Text | .txt |
Plain text files |
.pdf |
Portable Document Format | |
| Word | .docx |
Microsoft Word documents |
| Excel | .xlsx |
Microsoft Excel spreadsheets |
| CSV | .csv |
Comma-separated values |
GET /- Main application pagePOST /upload- File upload and analysis endpoint
- Local Processing: All AI processing happens locally using Ollama
- No Data Storage: Files are deleted immediately after analysis
- Secure Upload: File validation and secure filename handling
- Size Limits: 16MB maximum file size for security
- File Processing: < 2 seconds for most documents
- AI Analysis: 5-30 seconds depending on content length and model
- Memory Usage: Minimal, files processed in streaming fashion
- Supported Models: Any Ollama-compatible model
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Add support for more file formats (RTF, ODT)
- Implement batch file processing
- Add export functionality for analysis results
- Create API endpoints for programmatic access
- Add user authentication and session management
- Implement analysis history and favorites
- Add support for multiple AI models
- Create Docker containerization
- Large PDF files (>10MB) may take longer to process
- Complex Excel files with multiple sheets only process the first sheet
- Some PDF files with complex formatting may have text extraction issues
1. Ollama Connection Error
# Make sure Ollama is running
ollama serve
# Check if model is available
ollama list2. File Upload Issues
- Check file size (max 16MB)
- Verify file format is supported
- Ensure file is not corrupted
3. Module Import Errors
# Ensure virtual environment is activated
source venv/bin/activate # or venv\Scripts\activate on Windows
# Reinstall dependencies
pip install -r requirements.txtThis project is licensed under the MIT License - see the LICENSE file for details.
- Ollama for providing local AI capabilities
- Flask for the web framework
- PyPDF2 for PDF processing
- python-docx for Word document handling
If you encounter any issues or have questions:
- Check the Issues page.
- Create a new issue with detailed description.
- Join our Discussion forum.
β Star this repository if you find it helpful!
Made with β€οΈ by VAIBHAV TRIPATHI
