Merged in test/check-doc-dates-against-test-bed (pull request #380)

Test/check doc dates against test bed

* first commit

* Enhance prompts and processing for contract termination dates

- Updated prompt to include 'year to year' as a valid example output.
- Implemented case-insensitive processing for contract text and field keywords for smart chunking.
- Clarified prompt for derived termination date to specify it is exclusive of renewals

* Merge remote-tracking branch 'origin/main' into test/check-doc-dates-against-test-bed

* Update termination date prompt tests

* Refine keywords for contract termination date prompt in investment prompts


Approved-by: Katon Minhas
This commit is contained in:
Alex Galarce
2025-02-03 22:49:16 +00:00
parent 71e0eb5c45
commit e34262fc86
6 changed files with 743 additions and 14 deletions
@@ -0,0 +1,714 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Manual Test Bed\n",
"Runs contracts through from `input_data`, but cannot yet automatically check them against the answer key (that workbook is not yet clean enough)"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"os.chdir(\"../../\") # go to FieldExtraction folder"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(990, 1410)\n"
]
}
],
"source": [
"# Load target data from `scripts/investment_field_testing/input_data` directory\n",
"TEST_DATA_INPUT_DIR = \"scripts/investment_field_testing/input_data\"\n",
"df_targets = pd.read_excel(TEST_DATA_INPUT_DIR + \"/test_bed_investment.xlsx\", sheet_name=\"test_bed_investment\")\n",
"\n",
"print(df_targets.shape)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Sr no.</th>\n",
" <th>Client</th>\n",
" <th>Contract Name</th>\n",
" <th>Contract Type</th>\n",
" <th>CONTRACT_TITLE</th>\n",
" <th>CONTRACT_HEADER</th>\n",
" <th>CONTRACT_NUM</th>\n",
" <th>CONTRACT_BASE_TITLE</th>\n",
" <th>CONTRACT_BASE_EFFECTIVE_DT</th>\n",
" <th>CONTRACT_SIGNATORY_IND</th>\n",
" <th>...</th>\n",
" <th>NEURO_DAY_LIMIT_CARVEOUT_EXCEPTION</th>\n",
" <th>NEURO_PD_CARVEOUT_IND</th>\n",
" <th>NEURO_PD_CARVEOUT_IND_PG</th>\n",
" <th>NEURO_PD_CARVEOUT_CODES</th>\n",
" <th>NEURO_PD_CARVEOUT_TYPE_OF_CODE</th>\n",
" <th>NEURO_PD_CARVEOUT_REIMBURSEMENT_METHODOLOGY</th>\n",
" <th>NEURO_PD_CARVEOUT_SCHEDULE_NAME</th>\n",
" <th>NEURO_PD_CARVEOUT_SCHEDULE_VERSION</th>\n",
" <th>NEURO_PD_CARVEOUT_REIMBURSEMENT_RATE</th>\n",
" <th>NEURO_PD_CARVEOUT_EXCEPTION</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" <td>Molina Healthcare of TX</td>\n",
" <td>Custom_HSA_AMD 2_EFF08012023_Children's Medica...</td>\n",
" <td>Custom - Facility</td>\n",
" <td>Amendment Number Six to Molina Healthcare of T...</td>\n",
" <td>Amendment</td>\n",
" <td>6</td>\n",
" <td>Hospital Services Agreement</td>\n",
" <td>2012-03-01 00:00:00</td>\n",
" <td>Y</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2</td>\n",
" <td>Molina Healthcare of TX</td>\n",
" <td>Custom_HSA_AMD 2_EFF08012023_Children's Medica...</td>\n",
" <td>Custom - Facility</td>\n",
" <td>Amendment Number Six to Molina Healthcare of T...</td>\n",
" <td>Amendment</td>\n",
" <td>6</td>\n",
" <td>Hospital Services Agreement</td>\n",
" <td>2012-03-01 00:00:00</td>\n",
" <td>Y</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3</td>\n",
" <td>Molina Healthcare of TX</td>\n",
" <td>Custom_HSA_AMD 2_EFF08012023_Children's Medica...</td>\n",
" <td>Custom - Facility</td>\n",
" <td>Amendment Number Six to Molina Healthcare of T...</td>\n",
" <td>Amendment</td>\n",
" <td>6</td>\n",
" <td>Hospital Services Agreement</td>\n",
" <td>2012-03-01 00:00:00</td>\n",
" <td>Y</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>4</td>\n",
" <td>Molina Healthcare of TX</td>\n",
" <td>Custom_HSA_AMD 2_EFF08012023_Children's Medica...</td>\n",
" <td>Custom - Facility</td>\n",
" <td>Amendment Number Six to Molina Healthcare of T...</td>\n",
" <td>Amendment</td>\n",
" <td>6</td>\n",
" <td>Hospital Services Agreement</td>\n",
" <td>2012-03-01 00:00:00</td>\n",
" <td>Y</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>5</td>\n",
" <td>HealthNet of Cali</td>\n",
" <td>2017-07-01 St. Agnes Medical Center AMD MU.txt</td>\n",
" <td>Custom - Facility</td>\n",
" <td>Amendment to the Hospital Provider Services Ag...</td>\n",
" <td>Amendment</td>\n",
" <td>NaN</td>\n",
" <td>Hospital Provider Services Agreement</td>\n",
" <td>2009-09-01 00:00:00</td>\n",
" <td>Y</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>Y</td>\n",
" <td>6,7</td>\n",
" <td>33206-33208, 33214, 33222, 33233-33235</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>5 rows × 1410 columns</p>\n",
"</div>"
],
"text/plain": [
" Sr no. Client \\\n",
"0 1 Molina Healthcare of TX \n",
"1 2 Molina Healthcare of TX \n",
"2 3 Molina Healthcare of TX \n",
"3 4 Molina Healthcare of TX \n",
"4 5 HealthNet of Cali \n",
"\n",
" Contract Name Contract Type \\\n",
"0 Custom_HSA_AMD 2_EFF08012023_Children's Medica... Custom - Facility \n",
"1 Custom_HSA_AMD 2_EFF08012023_Children's Medica... Custom - Facility \n",
"2 Custom_HSA_AMD 2_EFF08012023_Children's Medica... Custom - Facility \n",
"3 Custom_HSA_AMD 2_EFF08012023_Children's Medica... Custom - Facility \n",
"4 2017-07-01 St. Agnes Medical Center AMD MU.txt Custom - Facility \n",
"\n",
" CONTRACT_TITLE CONTRACT_HEADER \\\n",
"0 Amendment Number Six to Molina Healthcare of T... Amendment \n",
"1 Amendment Number Six to Molina Healthcare of T... Amendment \n",
"2 Amendment Number Six to Molina Healthcare of T... Amendment \n",
"3 Amendment Number Six to Molina Healthcare of T... Amendment \n",
"4 Amendment to the Hospital Provider Services Ag... Amendment \n",
"\n",
" CONTRACT_NUM CONTRACT_BASE_TITLE \\\n",
"0 6 Hospital Services Agreement \n",
"1 6 Hospital Services Agreement \n",
"2 6 Hospital Services Agreement \n",
"3 6 Hospital Services Agreement \n",
"4 NaN Hospital Provider Services Agreement \n",
"\n",
" CONTRACT_BASE_EFFECTIVE_DT CONTRACT_SIGNATORY_IND ... \\\n",
"0 2012-03-01 00:00:00 Y ... \n",
"1 2012-03-01 00:00:00 Y ... \n",
"2 2012-03-01 00:00:00 Y ... \n",
"3 2012-03-01 00:00:00 Y ... \n",
"4 2009-09-01 00:00:00 Y ... \n",
"\n",
" NEURO_DAY_LIMIT_CARVEOUT_EXCEPTION NEURO_PD_CARVEOUT_IND \\\n",
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
"\n",
" NEURO_PD_CARVEOUT_IND_PG NEURO_PD_CARVEOUT_CODES \\\n",
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
"\n",
" NEURO_PD_CARVEOUT_TYPE_OF_CODE NEURO_PD_CARVEOUT_REIMBURSEMENT_METHODOLOGY \\\n",
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
"\n",
" NEURO_PD_CARVEOUT_SCHEDULE_NAME NEURO_PD_CARVEOUT_SCHEDULE_VERSION \\\n",
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN Y \n",
"\n",
" NEURO_PD_CARVEOUT_REIMBURSEMENT_RATE NEURO_PD_CARVEOUT_EXCEPTION \n",
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 6,7 33206-33208, 33214, 33222, 33233-33235 \n",
"\n",
"[5 rows x 1410 columns]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_targets.head()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"# Also change config.RUN_MODE and config.READ_MODE to 'local'\n",
"test_params = {}\n",
"test_params['local_input_dir'] = TEST_DATA_INPUT_DIR + \"/investment_228\"\n",
"test_params['max_workers'] = 1"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"doczy-output exists\n"
]
}
],
"source": [
"from src.investment.main import main as investment_main"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Total Input Files : 1\n",
"Processing Adena Health System National Template Agreement C19460229AA.txt...\n",
"Preprocessing Complete - Adena Health System National Template Agreement C19460229AA.txt\n",
"Running regex fields...\n",
"Running smart chunked fields...\n",
"field_group_answer_raw: I'll analyze the contract for each question and provide my reasoning, then give the final answers in JSON format.\n",
"\n",
"CONTRACT_EFFECTIVE_DT:\n",
"The effective date is clearly stated on the signature page: \"Effective Date: 04/01/2021\". This meets the criteria for an explicitly labeled effective date.\n",
"\n",
"CONTRACT_TITLE:\n",
"The title of the contract appears at the beginning of the document: \"CARESOURCE PROVIDER AGREEMENT\". This is in capital letters and contains the word \"AGREEMENT\", which matches the criteria given.\n",
"\n",
"CONTRACT_TERMINATION_DT:\n",
"The contract does not specify a specific termination date. Instead, it states in section 8.01: \"This Agreement shall begin on the Effective Date and shall continue from year to year on the anniversary of the Effective Date thereafter, unless terminated as set forth below.\" This indicates an automatic renewal structure rather than a fixed termination date.\n",
"\n",
"CONTRACT_AUTO_RENEWAL_IND:\n",
"Based on section 8.01, which states the agreement continues from year to year unless terminated, this contract does automatically renew. Therefore, the answer is Y.\n",
"\n",
"CONTRACT_AUTO_RENEWAL_TERM:\n",
"The auto-renewal term is specified in section 8.01 as \"from year to year\", which indicates a one-year renewal term.\n",
"\n",
"Here's the JSON with the final answers:\n",
"\n",
"{\n",
" \"CONTRACT_EFFECTIVE_DT\": \"04/01/2021\",\n",
" \"CONTRACT_TITLE\": \"CARESOURCE PROVIDER AGREEMENT\",\n",
" \"CONTRACT_TERMINATION_DT\": \"year to year\",\n",
" \"CONTRACT_AUTO_RENEWAL_IND\": \"Y\",\n",
" \"CONTRACT_AUTO_RENEWAL_TERM\": \"one year\"\n",
"}\n",
"Running full context fields...\n",
"One to One Complete - Adena Health System National Template Agreement C19460229AA.txt\n",
"The following is from a legal contract. Please provide the initial termination date of the contract (exclusive of renewals). Effective date: 04/01/2021; termination information: year to year\n",
"Feel free to justify your answer, but enclose your final answer in |pipes|. If the question cannot be answered with the given context, return |N/A|. \n",
" Based on the information provided, we can determine the initial termination date as follows:\n",
"\n",
"The contract has an effective date of 04/01/2021 (April 1, 2021).\n",
"The termination information states \"year to year,\" which typically means the contract will automatically renew annually unless terminated by either party.\n",
"\n",
"Given this, the initial termination date would be one year from the effective date, which is:\n",
"\n",
"|03/31/2022|\n",
"\n",
"This date represents the end of the first contract year, which is the initial termination date before any automatic renewals would take effect. The contract would then renew for another year starting 04/01/2022 if not terminated by either party.\n",
"Postprocessing Complete - Adena Health System National Template Agreement C19460229AA.txt\n"
]
}
],
"source": [
"df_out = investment_main(testing=True, test_params=test_params)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>CONTRACT_EFFECTIVE_DT</th>\n",
" <th>CONTRACT_TITLE</th>\n",
" <th>CONTRACT_TERMINATION_DT</th>\n",
" <th>CONTRACT_AUTO_RENEWAL_IND</th>\n",
" <th>CONTRACT_AUTO_RENEWAL_TERM</th>\n",
" <th>CONTRACT_FILE_NAME</th>\n",
" <th>CLIENT_NAME</th>\n",
" <th>AARETE_DERIVED_TERMINATION_DATE</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>04/01/2021</td>\n",
" <td>CARESOURCE PROVIDER AGREEMENT</td>\n",
" <td>year to year</td>\n",
" <td>Y</td>\n",
" <td>one year</td>\n",
" <td>Adena Health System National Template Agreemen...</td>\n",
" <td>Test-Client</td>\n",
" <td>03/31/2022</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" CONTRACT_EFFECTIVE_DT CONTRACT_TITLE \\\n",
"0 04/01/2021 CARESOURCE PROVIDER AGREEMENT \n",
"\n",
" CONTRACT_TERMINATION_DT CONTRACT_AUTO_RENEWAL_IND \\\n",
"0 year to year Y \n",
"\n",
" CONTRACT_AUTO_RENEWAL_TERM \\\n",
"0 one year \n",
"\n",
" CONTRACT_FILE_NAME CLIENT_NAME \\\n",
"0 Adena Health System National Template Agreemen... Test-Client \n",
"\n",
" AARETE_DERIVED_TERMINATION_DATE \n",
"0 03/31/2022 "
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_out.head()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# The following is not functional because we first need to clean the test bed"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['CONTRACT_EFFECTIVE_DT',\n",
" 'CONTRACT_TITLE',\n",
" 'CONTRACT_TERMINATION_DT',\n",
" 'CONTRACT_AUTO_RENEWAL_IND',\n",
" 'CONTRACT_AUTO_RENEWAL_TERM',\n",
" 'AARETE_DERIVED_TERMINATION_DATE']"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"one_to_one_fields = []\n",
"for col in df_out.columns:\n",
" if df_out[col].nunique() == 1:\n",
" # print(col, df_out[col].nunique())\n",
" one_to_one_fields.append(col)\n",
"\n",
"exclude_list = ['CONTRACT_CARVEOUT_IND', # 1:n\n",
" \"CONTRACT_GREATER_OF_IND\", # 1:n\n",
" \"CONTRACT_REIMBURSEMENT_FEE_RATE\", # 1:n\n",
" \"CONTRACT_NETWORK\", # dynamic\n",
" \"CONTRACT_CLAIM_TYPE_CD\", # not found in the source spreadsheet\n",
" \"CONTRACT_AMENDMENT_NUM\", # not found in the source spreadsheet\n",
" \"PROV_GROUP_NAME_FULL\", # not found in the source spreadsheet\n",
" \"PROV_FULL_NAME\", # This is called PROV_GROUP_NAME in the source spreadsheet\n",
" \"CONTRACT_FILE_NAME\", # not found in the source spreadsheet\n",
" \"CONTRACT_CARVEOUT_CD\", # 1:n, also not found in the source spreadsheet\n",
" 'PAYER_NAME',\n",
" 'CLIENT_NAME',\n",
" \n",
" ]\n",
"\n",
"one_to_one_fields = [item for item in one_to_one_fields \n",
" if item not in exclude_list]\n",
"\n",
"one_to_one_fields"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"mapping_main_to_testbed = {\"CONTRACT_AUTO_RENEWAL_TERM\" : \"CONTRACT_AUTO_RENEWAL_TERM_LENGTH\", \"AARETE_DERIVED_TERMINATION_DATE\" : \"CONTRACT_TERMINATION_DT\"}\n",
"\n",
"def apply_name_mapping(col: str):\n",
" if col in mapping_main_to_testbed:\n",
" return mapping_main_to_testbed[col]\n",
" return col"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0 2023-01-08 00:00:00\n",
"1 2023-01-08 00:00:00\n",
"2 2023-01-08 00:00:00\n",
"3 2023-01-08 00:00:00\n",
"4 2017-01-07 00:00:00\n",
"Name: CONTRACT_EFFECTIVE_DT, dtype: object\n",
"0 Amendment Number Six to Molina Healthcare of T...\n",
"1 Amendment Number Six to Molina Healthcare of T...\n",
"2 Amendment Number Six to Molina Healthcare of T...\n",
"3 Amendment Number Six to Molina Healthcare of T...\n",
"4 Amendment to the Hospital Provider Services Ag...\n",
"Name: CONTRACT_TITLE, dtype: object\n",
"0 2025-01-08 00:00:00\n",
"1 2025-01-08 00:00:00\n",
"2 2025-01-08 00:00:00\n",
"3 2025-01-08 00:00:00\n",
"4 30-06-2019\n",
"Name: CONTRACT_TERMINATION_DT, dtype: object\n",
"0 N\n",
"1 N\n",
"2 N\n",
"3 N\n",
"4 Y\n",
"Name: CONTRACT_AUTO_RENEWAL_IND, dtype: object\n",
"0 NaN\n",
"1 NaN\n",
"2 NaN\n",
"3 NaN\n",
"4 1 year\n",
"Name: CONTRACT_AUTO_RENEWAL_TERM_LENGTH, dtype: object\n",
"0 2025-01-08 00:00:00\n",
"1 2025-01-08 00:00:00\n",
"2 2025-01-08 00:00:00\n",
"3 2025-01-08 00:00:00\n",
"4 30-06-2019\n",
"Name: CONTRACT_TERMINATION_DT, dtype: object\n"
]
}
],
"source": [
"exclude_list = [\"CONTRACT_CLAIM_TYPE_CD\"]\n",
"\n",
"for field in one_to_one_fields:\n",
" field = apply_name_mapping(field)\n",
" # if field == \"CONTRACT_AUTO_RENEWAL_TERM\":\n",
" # field = \"CONTRACT_AUTO_RENEWAL_TERM_LENGTH\"\n",
" # elif field == \"AARETE_DERIVED_TERMINATION_DATE\":\n",
" # field = \"CONTRACT_TERMINATION_DT\"\n",
" # elif field == \"CONTRACT_CLAIM_TYPE_CD\":\n",
" print(df_targets[field].head())"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"CONTRACT_EFFECTIVE_DT 04/01/2021\n",
"CONTRACT_TITLE CARESOURCE PROVIDER AGREEMENT\n",
"CONTRACT_TERMINATION_DT year to year\n",
"CONTRACT_AUTO_RENEWAL_IND Y\n",
"CONTRACT_AUTO_RENEWAL_TERM one year\n",
"AARETE_DERIVED_TERMINATION_DATE 03/31/2022\n",
"Name: 0, dtype: object"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"row = df_out[one_to_one_fields].iloc[0]\n",
"row"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CONTRACT_EFFECTIVE_DT LLM answer: 04/01/2021\n",
"the date set forth on the signature page \n",
"\n",
"CONTRACT_TITLE LLM answer: CARESOURCE PROVIDER AGREEMENT\n",
"CARESOURCE_x000D_\n",
"PROVIDER AGREEMENT \n",
"\n",
"CONTRACT_TERMINATION_DT LLM answer: year to year\n",
"2022-01-04 00:00:00 \n",
"\n",
"CONTRACT_AUTO_RENEWAL_IND LLM answer: Y\n",
"Yes \n",
"\n",
"CONTRACT_AUTO_RENEWAL_TERM LLM answer: one year\n",
"1 year \n",
"\n",
"AARETE_DERIVED_TERMINATION_DATE LLM answer: 03/31/2022\n",
"2022-01-04 00:00:00 \n",
"\n"
]
}
],
"source": [
"filter_target = df_targets[df_targets['Contract Name'] == 'Adena Health System National Template Agreement C19460229AA.txt']\n",
"\n",
"for field, answer in row.items():\n",
" print(field, f\"LLM answer: {answer}\")\n",
" print(filter_target[apply_name_mapping(field)].iloc[0],\"\\n\")"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"\n",
"# filter_target"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "doczy-smart-chunking-blZ6pB_m-py3.12",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}