-
Download Ollama:
- Go to https://ollama.ai
- Download the Windows installer
- Run the installer and follow the instructions
-
Verify Installation:
ollama --version
-
Start Ollama Service:
ollama serve
-
Pull a Model (in a new terminal):
ollama pull llama3.2
Other good models for Arabic content:
ollama pull qwen2.5 ollama pull mistral
cd "d:\INTERNSHIP\pdf_analyzer"
pip install -r requirements.txt-
Test Ollama:
ollama list
You should see the models you pulled.
-
Test with a simple question:
ollama run llama3.2 "Hello, how are you?"
-
Start the Streamlit app:
streamlit run pdf_analyzer.py
-
Open browser to: http://localhost:8501
-
Upload your PDF and start asking questions!
python cli.py "1-النظام الأساسي للحكم.pdf"Double-click run_app.bat to start the web interface.
- Use models like
qwen2.5which have better Arabic support - Ask questions in Arabic for better understanding
- The system will maintain the language of the source document
- Large documents: Use chunk size 800-1000
- Small documents: Use chunk size 300-500
- Technical documents: Use smaller chunks (200-400)
- General documents:
llama3.2,mistral - Technical/Legal:
qwen2.5 - Code documentation:
codellama
- Make sure Ollama is installed and in your PATH
- Restart your terminal after installation
- Try running
ollama servefirst
- Run
ollama pull model-nameto download the model - Check available models with
ollama list
- Ensure the PDF contains selectable text (not just images)
- Try with a different PDF file
- Check if the PDF is password protected
- Reduce chunk size in the web interface
- Close other applications to free memory
- Use a smaller model like
llama3.2:8binstead of larger variants
-
Upload the Arabic PDF:
1-النظام الأساسي للحكم.pdf -
Ask questions like:
- "ما هو موضوع هذه الوثيقة؟"
- "اذكر أهم النقاط في النظام"
- "ما هي المواد المتعلقة بالحكم؟"
-
The system will:
- Find relevant sections in the PDF
- Generate answers based only on the PDF content
- Show you the source pages for verification