Key improvements: 1. Double verification mechanism for OCR failures - When unwarp OCR fails (empty text), automatically try PaddleOCRVL backup on crop - Fixes issue where correct seal was ignored due to unwarp image distortion - Test result: 4% → 93.8% similarity on problematic PDFs 2. Institution name cleaning - Remove unwanted suffixes: 检验检测专用章, 专用章, etc. - Clean names before adding to results and similarity calculation - Improves matching accuracy 3. Enhanced logging for institution selection - Show all extracted institutions with similarity scores - Track why specific institution was selected - Better debugging and transparency Example impact: - Before: "成都虹之川科技有限公司" (wrong seal, 4% similarity) - After: "中科测试技术(广东)集团有限公司" (correct seal, 93.8% similarity) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| data | ||
| report_viz | ||
| scripts | ||
| src | ||
| temp_classpath | ||
| .gitignore | ||
| ManualTest.java | ||
| PADDLEOCRVL_INTEGRATION.md | ||
| README.md | ||
| jar_paths.txt | ||
| pom.xml | ||
| reply.md | ||
| res.json | ||
| run_reference_test.bat | ||
| run_test.bat | ||
| run_test_v2.bat | ||
| run_viz_report.bat | ||
| settings.xml | ||
| test_accuracy_batch_full.py | ||
| test_paddleocr_vl_quick.py | ||
| v_verify_logic.py | ||
README.md
Report Detection Backend
Java-based backend system for automated report validation and comparison using OCR.
Technology Stack
- Core: Java 8 (Spring Boot 2.7.18)
- Security: Sa-Token (RBAC, Session Management)
- OCR Engine: PaddleOCR (via DJL - Deep Java Library)
- Database: PostgreSQL (with Dynamic Datasource support)
- Build Tool: Maven
Features
- RBAC Implementation: Multi-role support (ADMIN, AUDITOR, USER) with uppercase standardization.
- Sa-Token Security: Annotation-based permission checks and secure login.
- Auditor Context Switch: Specialized feature for Auditors to switch between institutional views.
- PDF Processing: Automatic conversion of PDF reports to images for OCR analysis.
- Automated Verification: Integration tests using H2 in-memory database.
Getting Started
Prerequisites
- JDK 8 or 17
- Maven 3.6+
- PostgreSQL (optional for local dev if using H2 profile)
Run the Application
mvn clean package
java -jar target/report-detect-backend-1.0.0.jar
Run Tests
mvn test -Dtest=SecurityRBACVerificationTest
Security Configuration
Default accounts created on initialization:
admin/123456(ADMIN)auditor/123456(AUDITOR)user/123456(USER)