Fix HIMS false positive for prohibited food classification#5
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a false positive in the prohibited food screening by switching from simple substring matching to a regex-based word boundary check.
- Updated Islamic screening logic using regex word boundaries for more accurate matching
- Introduced a new test case to verify that HIMS is correctly marked as Shariah compliant
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| utils/islamic_screening.py | Replaced substring matching with regex to prevent false positives |
| test_main.py | Added comprehensive test case to verify HIMS compliance |
Removing the explicit call to lower() on 'industry' as the re.IGNORECASE flag already handles case-insensitive matching. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Keep regex-based matching in islamic_screening.py for more precise filtering - Remove old test_main.py in favor of new organized test structure - Integrate CI/CD improvements and test coverage from main branch
|
Claude finished @danialranjha's task —— View job Code Review CompleteI've thoroughly reviewed this PR that fixes the HIMS false positive in Islamic screening. Here's my comprehensive feedback: Todo List:
📋 Code Review Findings✅ Code Quality & Best PracticesExcellent Implementation: The regex word boundary approach ( Proper Escaping: Using Consistent Pattern: The same regex pattern is applied across all text fields (company_name, industry, business_summary, sector), ensuring uniform matching behavior.
|
Summary
Test plan
Generated with Claude Code