Spaces:
Sleeping
Sleeping
| title: OCR Notification & Data Extractor | |
| emoji: π§Ύ | |
| colorFrom: blue | |
| colorTo: indigo | |
| sdk: gradio | |
| sdk_version: 4.44.0 | |
| app_file: app.py | |
| pinned: false | |
| license: mit | |
| # OCR Notification & Data Extractor | |
| Upload scanned PDFs or images and turn them into structured, exportable | |
| data. Built for teams that need to pull actionable "notification" events | |
| and key fields out of paper-heavy workflows: | |
| - **Construction / SAP data support** β change orders, delay notices, | |
| punch list items, RFIs, PO numbers, SAP document numbers, quantities. | |
| - **Compliance** β non-conformances, violations, expirations, corrective | |
| actions, certification codes (ISO, OSHA, ASTM, ANSI). | |
| - **Business finance** β past-due invoices, payment rejections, credit | |
| holds, invoice numbers, dollar amounts, due dates. | |
| ## How it works | |
| 1. Upload one or more PDFs or images. | |
| 2. Each page's text is pulled directly from the PDF when it has a text | |
| layer; scanned/image-only pages are rendered and run through | |
| Tesseract OCR. | |
| 3. The text is scanned against keyword sets for the categories you pick | |
| (or your own custom keywords), and structured fields (PO/SAP/invoice | |
| numbers, dates, dollar amounts, percentages, certification codes) are | |
| pulled out with regex. | |
| 4. Results are shown in a table and exported as a CSV, one row per page | |
| that has a hit (or every page, if you turn that filter off). | |
| ## Local development | |
| ```bash | |
| pip install -r requirements.txt | |
| # Tesseract must also be installed on the system, e.g.: | |
| # apt-get install tesseract-ocr | |
| python app.py | |
| ``` | |
| ## Files | |
| - `app.py` β Gradio UI and orchestration. | |
| - `ocr_engine.py` β PDF/image loading and OCR (PyMuPDF + Tesseract). | |
| - `extractors.py` β keyword notification scanning and structured field | |
| extraction (regex-based, easy to extend per domain). | |