A terminal application that uses spaCy + Ollama to analyze PDFs and create intelligent True/False quizzes with structured data extraction.
- Install Python dependencies:
pip install -r requirements.txt- Download spaCy model for English (recommended):
python -m spacy download en_core_web_trfAlternatives (if space is limited):
python -m spacy download en_core_web_md # Good accuracy
python -m spacy download en_core_web_sm # Fast but basic- Install Ollama:
# macOS
brew install ollama
# Linux
curl -fsSL https://ollama.ai/install.sh | sh
# Windows
# Download from https://ollama.ai/download- Install Ollama Python package:
pip install ollama- Download Ollama model:
ollama pull llama2-
Place your PDF file in the
pdfs/folder -
Start Ollama service (in a separate terminal):
ollama serve- Run the application (in another terminal):
python main.py- Follow the instructions to select PDF and answer questions
- Keep
ollama serverunning while using the application - The first run may take longer as models are loaded
- If AI is not available, the system will use rule-based questions as fallback
- Structured Data Extraction: spaCy extracts entities, relationships, and facts from PDFs
- AI-Powered Questions: Ollama generates intelligent questions from structured data
- Hybrid Approach: Combines rule-based extraction with AI generation for best results
- Fallback System: Works even without AI (rule-based questions as backup)
- Interactive Quiz: Elegant terminal interface with immediate feedback
- Educational Quality: Questions test understanding, not just memorization
- Multi-Model Support: Automatically selects best available spaCy model (trf > md > sm)
- Python 3.8+
- 4GB+ RAM (for Ollama models)
- Internet connection (for initial model downloads)
- macOS/Linux/Windows (Ollama support)