11.7 资格审查货物标修改
This commit is contained in:
parent
c828a74639
commit
0267a1884a
@ -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":{}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
@ -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 参数测试不同的场景
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user