diff --git a/fieldExtraction/src/investment/postprocess.py b/fieldExtraction/src/investment/postprocess.py index 2ecb0bc..2eca103 100644 --- a/fieldExtraction/src/investment/postprocess.py +++ b/fieldExtraction/src/investment/postprocess.py @@ -28,6 +28,14 @@ def postprocess(df): # Derived termination date df['AARETE_DERIVED_TERMINATION_DATE'] = list(map(invoke_derived_term_date, df['CONTRACT_EFFECTIVE_DT'], df['CONTRACT_TERMINATION_DT'])) + # Special handling for AARETE_DERIVED_TERMINATION_DATE + # Overwrite AARETE_DERIVED_TERMINATION_DATE "9999/01/01" if CONTRACT_AUTO_RENEWAL_IND is "Y" + if "AARETE_DERIVED_TERMINATION_DATE" in df.columns and "CONTRACT_AUTO_RENEWAL_IND" in df.columns: + df.loc[ + df["CONTRACT_AUTO_RENEWAL_IND"] == "Y", + "AARETE_DERIVED_TERMINATION_DATE" + ] = "9999/01/01" + # Standardize output column order - this should ALWAYS be the final postprocessing step diff --git a/fieldExtraction/src/prompts/investment_prompts.json b/fieldExtraction/src/prompts/investment_prompts.json index f9bd03b..038c828 100644 --- a/fieldExtraction/src/prompts/investment_prompts.json +++ b/fieldExtraction/src/prompts/investment_prompts.json @@ -284,7 +284,7 @@ "field_name": "CONTRACT_AUTO_RENEWAL_IND", "relationship": "one_to_one", "field_type": "smart_chunked", - "prompt": "If this contract automatically renews, answer Y. If this contract will remain in effect unless terminated, answer Y. If it will terminate after the mentioned termination date, answer N.", + "prompt": "If this contract automatically renews, answer Y. If this contract will remain in effect unless terminated, answer Y. Otherwise, answer N.", "keywords" : ["Renew", "renew", "Auto renew", "auto renew", "automatically renew", "evergreen", "Evergreen"], "methodology" : "or", "case_sensitive" : "True" @@ -293,7 +293,7 @@ "field_name": "CONTRACT_AUTO_RENEWAL_TERM", "relationship": "one_to_one", "field_type": "smart_chunked", - "prompt": "If contract automatically renews, then what is the length of the renewal term? This is related to the term and termination agreement section of the contract. This should a one or two word statement, typically around renewal, automatic renewal, or auto-renewal. Only return the length of time for the renewal, do not provide any context.", + "prompt": "If contract automatically renews, then what is the length of the renewal term? This is related to the term and termination agreement section of the contract. This should be a one or two word statement, typically around renewal, automatic renewal, or auto-renewal. Only return the length of time for the renewal, do not provide any context.", "keywords" : ["Renew", "renew", "Auto renew", "auto renew", "automatically renew", "evergreen", "Evergreen"], "methodology" : "or", "case_sensitive" : "True"