Merged in refactor/placeholders (pull request #363)
Add get_aarete_derived as a placeholder * Add get_aarete_derived as a placeholder * Merged main into refactor/placeholders Approved-by: Alex Galarce
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import src.config as config
|
||||
from src.prompts.investment_prompts import Field, FieldSet
|
||||
|
||||
|
||||
def get_aarete_derived(contract_answers: dict):
|
||||
aarete_derived_fields = FieldSet(file_path=config.FIELD_JSON_PATH, field_type="aarete_derived")
|
||||
|
||||
for field in aarete_derived_fields.fields:
|
||||
pass
|
||||
# 1. Get base field
|
||||
# 2. Get base field answer from contract_answer
|
||||
# 3. Run relevant prompt/crosswalk process
|
||||
# 4. Add AARETE_DERIVED_ answers to contract_answers
|
||||
|
||||
# contract_answers should have all fields, both CONTRACT_ and AARETE_DERIVED_ now
|
||||
return contract_answers
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import src.investment.one_to_n_funcs as one_to_n_funcs
|
||||
import src.investment.one_to_one_funcs as one_to_one_funcs
|
||||
import src.investment.postprocess as postprocess
|
||||
import src.investment.preprocess as preprocess
|
||||
import src.investment.aarete_derived as aarete_derived
|
||||
import src.investment.smart_chunking_funcs as smart_chunking_funcs
|
||||
from src.prompts.investment_prompts import Field, FieldSet
|
||||
from src import config
|
||||
@@ -35,9 +36,12 @@ def process_file(file_object, run_timestamp):
|
||||
if string_utils.contains_reimbursement(contract_text):
|
||||
one_to_n_results = run_one_to_n_prompts(filename, text_dict, exhibit_pages, exhibit_chunk_mapping) # Return df
|
||||
one_to_n_results['CONTRACT_FILE_NAME'] = filename
|
||||
final_results = pd.merge(one_to_one_results, one_to_n_results, how='right', on='CONTRACT_FILE_NAME')
|
||||
contract_results = pd.merge(one_to_one_results, one_to_n_results, how='right', on='CONTRACT_FILE_NAME')
|
||||
else:
|
||||
final_results = one_to_n_results
|
||||
contract_results = one_to_n_results
|
||||
|
||||
################## AARETE-DERIVED ##################
|
||||
final_results = aarete_derived.get_aarete_derived(contract_results)
|
||||
|
||||
################## POSTPROCESS ##################
|
||||
final_df = postprocess.postprocess(final_results)
|
||||
|
||||
Reference in New Issue
Block a user