diff --git a/fieldExtraction/src/hotfix_helper_funcs.py b/fieldExtraction/src/hotfix_helper_funcs.py index 7d63fa7..a51384a 100644 --- a/fieldExtraction/src/hotfix_helper_funcs.py +++ b/fieldExtraction/src/hotfix_helper_funcs.py @@ -72,10 +72,10 @@ def clean_output_postprocess(merged_df): merged_df['dummy_other'] = merged_df['dummy_other'].apply(lambda lst: [x for x in [remove_alphabets(x) for x in lst] if x is not None]) merged_df['dummy_other_signatory'] = merged_df['dummy_other_signatory'].apply(lambda lst: [x for x in [remove_alphabets(x) for x in lst] if x is not None]) - merged_df['dummy'] = merged_df['dummy'].apply(lambda lst: [add_hyphen_if_needed(x) for x in lst]) - merged_df['dummy_other'] = merged_df['dummy_other'].apply(lambda lst: [add_hyphen_if_needed(x) for x in lst]) - merged_df['dummy_other_signatory'] = merged_df['dummy_other_signatory'].apply(lambda lst: [add_hyphen_if_needed(x) for x in lst]) - + merged_df['dummy'] = merged_df['dummy'].apply(lambda lst: [x for x in [add_hyphen_if_needed(x) for x in lst] if x is not None]) + merged_df['dummy_other'] = merged_df['dummy_other'].apply(lambda lst: [x for x in [add_hyphen_if_needed(x) for x in lst] if x is not None]) + merged_df['dummy_other_signatory'] = merged_df['dummy_other_signatory'].apply(lambda lst: [x for x in [add_hyphen_if_needed(x) for x in lst] if x is not None]) + merged_df['dummy'] = merged_df['dummy'].apply(list_to_string) merged_df['dummy_other'] = merged_df['dummy_other'].apply(list_to_string) merged_df['dummy_other_signatory'] = merged_df['dummy_other_signatory'].apply(list_to_string) diff --git a/fieldExtraction/src/utils.py b/fieldExtraction/src/utils.py index e8e68c8..1d2777f 100644 --- a/fieldExtraction/src/utils.py +++ b/fieldExtraction/src/utils.py @@ -352,6 +352,6 @@ def add_hyphen_if_needed(input_str): # Ensure the output is in the format 'xx-xxxxxxx' if not bool(re.fullmatch(r"\b\d{2}-\d{7}\b", input_str)): - input_str = 'N/A' + input_str = None return input_str \ No newline at end of file