Merged in feature/add-billed-charges-to-reimb-keywords (pull request #436)

Small fix to comparisons (lowercase comparison string fields)

* Add accuracy calculation to fuzzy matching evaluation

* reimbursement primary accuracy test

* add match_threshold control

* clarify metrics

* Merged main into reimb-primary-accuracy-analysis

* Merge branch 'reimb-primary-accuracy-analysis' of https://bitbucket.org/aarete/doczy.ai into reimb-primary-accuracy-analysis

* add 'billed charges' to reimbursement keywords and update TODO for page checking

* add comparisons dictionary

* normalize field comparison by converting strings to lowercase

* deduplicate data sources in notebook

* Merge remote-tracking branch 'origin/main' into feature/add-billed-charges-to-reimb-keywords


Approved-by: Katon Minhas
This commit is contained in:
Alex Galarce
2025-03-06 21:42:43 +00:00
parent 60c3104119
commit cb6284c98f
3 changed files with 5462 additions and 89 deletions
@@ -238,9 +238,11 @@ reimbursement_strings = [ # These are for `method='keyword'`
"%",
"$",
"percent",
"billed charges"
]
reimb_regex = r"(?<![$%])(?:\$\d+|\d+[$%])(?![$%])"
# TODO: check should this always be checking just page 1? Bc in file_processing and table_utils it is but in preprocessing_funcs it's checking specific pages
def contains_reimbursement(text, page="1", method="keyword"):
"""
Checks if the given text contains any reimbursement-related keywords or patterns.