Updated primary prompt for examples

This commit is contained in:
Katon Minhas
2024-06-17 21:36:48 -07:00
committed by Michael McGuinness
parent 4576ad4c63
commit 6deea0071e
3 changed files with 12 additions and 5 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ def process_file(file_object):
combined_df.to_csv(os.path.join(output_dir, config.UNPROCESSED_RESULTS_NAME), index=False)
################## RUN POSTPROCESSING ##################
#combined_df = combined_df.applymap(postprocessingfuncs.sanitize_value) # Deprecated
# combined_df = combined_df.applymap(postprocessingfuncs.sanitize_value) # Deprecated
combined_df = combined_df.apply(lambda x: x.map(postprocessingfuncs.sanitize_value))
post_processed_combined_df = postprocess.postprocess_results(combined_df)
+1 -1
View File
@@ -38,7 +38,7 @@ def BOTTOM_UP_PRIMARY(page, payer):
The preceding text is one page of a contract between Payer {payer} and a provider in their network. Your job is to extract attributes related to the reimbursement of different services and specialties.
The reimbursement values will be identified with >>> <<< indicators (e.g. >>>105%<<<). Make sure there is at least one dictionary object for EVERY reimbursement value seen (either % or $).
The reimbursement values will be identified with >>> <<< indicators (e.g. >>>105%<<<). Make sure there is at least one dictionary object for EVERY reimbursement value seen (either % or $). Some values are found in sections identified as examples - these must be omitted from output.
If any of the attributes are not found, return N/A. For all attributes, only write what is written on the page. Do not make up new phrases or words.
+10 -3
View File
@@ -29,9 +29,16 @@ import claude_funcs
# final_df = pd.concat(all_dfs, ignore_index=True)
# final_df.to_excel('output_consolidated/test_20240610_batch1.xlsx')
combined_df = pd.read_csv('output/2017-07-01 Cedars-Sinai Medical Center CSMF CDM AMD MU/combined_results_unprocessed.csv')
combined_df = combined_df.apply(lambda x: x.map(postprocessingfuncs.sanitize_value))
input_dict = utils.read_input()
post_processed_combined_df = postprocess.postprocess_results(combined_df)
(filename, contract_text) = list(input_dict.items())[0]
contract_text = preprocess.clean_newlines(contract_text)
text_dict = preprocess.split_text(contract_text)
text_dict = table_funcs.align_and_format_tables(text_dict)
text_dict = preprocess.highlight_rates(text_dict)
bu_results = prompt_funcs.run_bottom_up_primary({'5' : text_dict['5']}, 4000) # Returns list of dictionaries
print(bu_results)