Implement async PDF processing for owner's manuals with maintenance
schedule extraction:
- Add PDF preprocessor with PyMuPDF for text/scanned PDF handling
- Add maintenance pattern matching (mileage, time, fluid specs)
- Add service name mapping to maintenance subtypes
- Add table detection and parsing for schedule tables
- Add manual extractor orchestrating the complete pipeline
- Add POST /extract/manual endpoint for async job submission
- Add Redis job queue support for manual extraction jobs
- Add progress tracking during processing
Processing pipeline:
1. Analyze PDF structure (text layer vs scanned)
2. Find maintenance schedule sections
3. Extract text or OCR scanned pages at 300 DPI
4. Detect and parse maintenance tables
5. Normalize service names and extract intervals
6. Return structured maintenance schedules with confidence scores
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Files Changed
New Files
ocr/app/patterns/maintenance_patterns.py- Mileage, time, fluid spec patternsocr/app/patterns/service_mapping.py- Service name to subtype mappingocr/app/preprocessors/pdf_preprocessor.py- PDF text/image extractionocr/app/table_extraction/detector.py- Table detection in images/textocr/app/table_extraction/parser.py- Table content parsingocr/app/extractors/manual_extractor.py- Main extraction orchestratorocr/tests/test_maintenance_patterns.py- Pattern matching testsocr/tests/test_service_mapping.py- Service mapping testsocr/tests/test_table_parser.py- Table parsing testsModified Files
ocr/app/models/schemas.py- Manual extraction response modelsocr/app/routers/extract.py- POST /extract/manual endpointocr/app/services/job_queue.py- Manual job queue methodsocr/requirements.txt- Added PyMuPDF dependencyTest Plan
Closes #71