Project Concept: BioCoursesGenerator¶
Overview¶
BioCoursesGenerator is a Streamlit-based web application designed to automate the generation of educational course materials from scanned curriculum documents. The system leverages Optical Character Recognition (OCR) for text extraction, Large Language Model (LLM) processing for content structuring, and PDF generation to produce comprehensive course books for medical and nursing education.
Core Functionality¶
- Curriculum Input Processing
- Accepts scanned PDF or image files containing tabular curriculum structures
- Performs image preprocessing including automatic rotation correction for crooked scans
- Performs OCR extraction (via Tesseract) to convert images to editable text
-
Recognizes hierarchical lesson structures through LLM analysis
-
Content Structuring via LLM
- Sends extracted curriculum text to LLM API for processing
- Generates structured Table of Contents (TOC) with hierarchical sections and detailed content prompts
- API Endpoint:
http://127.0.0.1:7998/gpt_generate_book_toc_with_prompts - Request format:
``json { "context": "Create a course for post-graduate medical students", "what_to_build": "Generate lessons covering systematic progression through nursing interventions, surgical care, orthopedic treatment, trauma management, care plan evaluation, intervention assessment, chronic problem restructuring, quality evaluation. Total time: 8 hours. Domains: General Surgery (2h), Orthopedics & Trauma (2h), Urinary System Disorders...", "language": "romana" } -
Response provides link to generated TOC file with specific format: numbered sections followed by
#!#and detailed content prompts -
TOC Modification (Future Implementation)
- Allow users to edit generated TOC: add/remove/rename sections
- Modify prompts and reorganize structure
-
Implement tree-based editing interface
-
PDF Book Generation
- Send TOC to PDF generation API
- Endpoint:
http://127.0.0.1:7998/gpt_toc_to_pdf - Request:
{"link": "toc_file_url"} - Downloads generated PDF to
/outputs/directory
Technical Architecture Components¶
Frontend¶
- Streamlit web interface for file upload and processing control
Backend Processing¶
- OCR module using pytesseract
- LLM API integration for content structuring
- PDF generation and download handling
Data Flow¶
Scanned Document → OCR Extraction → LLM Content Processing → TOC Generation → User Editing (optional) → PDF Compilation → Download
Nice-to-Have Features¶
- Pre-processing text editing interface for manual corrections/removals before LLM processing
- TOC visualization and manipulation in tree format
- Document upload to server for link-based API consumption