11.7 资格审查货物标修改

This commit is contained in:
zy123 2024-11-07 16:22:52 +08:00
parent c828a74639
commit 0267a1884a
3 changed files with 22 additions and 20 deletions

View File

@ -96,7 +96,8 @@ def get_technical_requirements(file_id,invalid_path):
if '' in judge_res:
file_id=upload_file(invalid_path)
user_query1 = """
请你首先定位该采购文件中的采购清单或采购需求部分请告诉我需要采购的货物如果有采购清单请直接根据清单上的货物或系统名称给出结果若没有采购清单你要从表格中或文中摘取需要采购的系统或货物采购需求中可能包含层次关系例如采购的某大系统中可能包含几种货物那么你需要用嵌套键值对表示这种关系且不要遗漏该系统中包含的货物你的输出请以json格式返回最外层键名为'采购需求'嵌套键名为对应的系统名称或货物名称需与原文保持一致无需给出采购数量和单位如有未知内容在对应键值处填'未知'以下为示例输出
请你首先定位该采购文件中的采购清单或采购需求部分请告诉我需要采购的货物如果有采购清单请直接根据清单上的货物或系统名称给出结果若没有采购清单你要从表格中或文中摘取需要采购的系统或货物
采购需求中可能包含层次关系例如采购的某大系统中可能包含几种货物那么你需要用嵌套键值对表示这种关系且不要遗漏该系统中包含的货物你的输出请以json格式返回最外层键名为'采购需求'嵌套键名为对应的系统名称或货物名称需与原文保持一致无需给出采购数量和单位以下为需要考虑的特殊情况如果同一层级下存在同名货物且它们的技术参数要求有所不同请在货物名后添加后缀'-n'n为自然数依次递增如有未知内容在对应键值处填'未知'以下为示例输出
{
"采购需求": {
"门禁管理系统": {},
@ -104,8 +105,9 @@ def get_technical_requirements(file_id,invalid_path):
"高清视频抓拍像机":{},
"补光灯":{}
},
"LED全彩显示屏": {},
"数字会议发言主机": {},
"LED全彩显示屏": {},
"交换机-1"{},
"交换机-2":{}
}
}
"""

View File

@ -40,18 +40,18 @@ def extract_between_sections(data, target_values):
return extracted_data
def process_with_outer_key(data):
processed_data = {}
# 遍历外层的键值对
for outer_key, inner_data in data.items():
# 调用 transform_json 函数对内层数据进行处理
processed_inner_data = transform_json(inner_data)
# 将处理后的数据保留在外层键下
processed_data[outer_key] = processed_inner_data
return processed_data
# def process_with_outer_key(data):
# processed_data = {}
#
# # 遍历外层的键值对
# for outer_key, inner_data in data.items():
# # 调用 transform_json 函数对内层数据进行处理
# processed_inner_data = transform_json(inner_data)
#
# # 将处理后的数据保留在外层键下
# processed_data[outer_key] = processed_inner_data
#
# return processed_data
"""
@ -109,7 +109,7 @@ def extract_from_notice(merged_baseinfo_path,clause_path, type):
# print(json.dumps(extracted_data,ensure_ascii=False,indent=4))
extracted_data_concatenated = {section: concatenate_keys_values(content) #启用结构化就注释这三行
for section, content in extracted_data.items()}
extracted_data_concatenated[data]=1
return extracted_data_concatenated
# transformed_data = process_with_outer_key(extracted_data) #取消注释这三行
# final_result = process_nested_data(transformed_data)
@ -121,8 +121,8 @@ def extract_from_notice(merged_baseinfo_path,clause_path, type):
return DEFAULT_RESULT
if __name__ == "__main__":
clause_path = r'C:\Users\Administrator\Desktop\fsdownload\6b251074-bd29-4bd5-a776-3a11c20e6b11\\clause1.json'
merged_baseinfo_path=r"C:\Users\Administrator\Desktop\fsdownload\6b251074-bd29-4bd5-a776-3a11c20e6b11\ztbfile_merged_baseinfo.pdf"
clause_path = r'C:\Users\Administrator\Desktop\fsdownload\a110ed59-00e8-47ec-873a-bd4579a6e628\\clause1.json'
merged_baseinfo_path=r"C:\Users\Administrator\Desktop\fsdownload\a110ed59-00e8-47ec-873a-bd4579a6e628\ztbfile_merged_baseinfo.pdf"
# file_path = 'D:\\flask_project\\flask_app\\static\\output\\fee18877-0c60-4c28-911f-9a5f7d1325a7\\clause1.json'
try:
res = extract_from_notice(merged_baseinfo_path,clause_path, 1) # 可以改变此处的 type 参数测试不同的场景

View File

@ -97,10 +97,10 @@ def fetch_project_basic_info(invalid_path,invalid_docpath, merged_baseinfo_path,
return base_info, good_list
def fetch_qualification_review(invalid_path, output_folder, qualification_path, notice_path):
def fetch_qualification_review(invalid_path,qualification_path, notice_path):
logger.info("starting 资格审查...")
start_time = time.time()
review_standards_res = combine_qualification_review(invalid_path, output_folder, qualification_path, notice_path)
review_standards_res = combine_qualification_review(invalid_path,qualification_path, notice_path)
end_time = time.time()
logger.info(f"资格审查 done耗时{end_time - start_time:.2f}")
return review_standards_res