feat: Introduce AI extraction schema with validation, prompt generation, and a verification script to improve price extraction reliability.

This commit is contained in:
Michael committed 2025-12-18 16:32:32 +01:00
1 parent ef7cd7c1cf
commit 384baa3575
4 files changed
+230 -5

No files matched your search

+12
View File
@@ -18,6 +18,15 @@ Implementing logic to generate unique timestamped filenames for screenshots to b
- [x] Update `ItemService.delete_item` to clean up all related screenshots <!-- id: 6 -->
- [x] Create `verify_fix_item_service.py` to test the new logic <!-- id: 5 -->
## Current Focus
Improving price extraction reliability for B&M Stores and others.
- [x] Analyze `ai_schema.py` to check the extraction prompt <!-- id: 7 -->
- [x] Improve `ScraperService._extract_text` to be more targeted (e.g. main content only) <!-- id: 8 -->
- [x] Update AI prompt to better handle multiple prices (unit vs package) <!-- id: 9 -->
- [x] Verify extraction logic with simulation script <!-- id: 10 -->
## Progress Log
- Identified the issue: `ScraperService` overwrites `item_{id}.png`.
@@ -25,3 +34,6 @@ Implementing logic to generate unique timestamped filenames for screenshots to b
- User approved plan.
- Implemented filesystem scanning in `ItemService`.
- Verified fix with `verify_fix_item_service.py` successfully.
- Improved AI prompt to ignore unit prices (like "Prix au litre").
- Enhanced text extraction to remove menu/footer noise.
- Verified logic with `verify_extraction_logic.py` (simulated).