2024-08-29 16:37:09 +08:00
|
|
|
|
import os
|
|
|
|
|
|
2024-08-29 17:30:49 +08:00
|
|
|
|
from flask_app.main.投标人须知正文条款提取成json文件 import convert_clause_to_json
|
|
|
|
|
from flask_app.main.json_utils import nest_json_under_key, extract_content_from_json
|
|
|
|
|
from flask_app.main.形式响应评审 import process_reviews
|
|
|
|
|
from flask_app.main.资格评审 import process_qualification
|
|
|
|
|
from flask_app.main.通义千问long import upload_file, qianwen_long
|
2024-09-05 18:00:40 +08:00
|
|
|
|
from concurrent.futures import ThreadPoolExecutor
|
2024-08-29 16:37:09 +08:00
|
|
|
|
|
|
|
|
|
|
2024-09-06 15:50:52 +08:00
|
|
|
|
def combine_review_standards(truncate1,truncate3,knowledge_name,truncate0_jsonpath,clause_path,input_file,output_folder): #评标办法前附表
|
2024-08-29 16:37:09 +08:00
|
|
|
|
# 形式评审、响应评审:千问
|
|
|
|
|
print("starting形式响应评审...")
|
|
|
|
|
file_id=upload_file(truncate1) #评标办法前附表
|
|
|
|
|
user_query_1 = "根据该文档中的评标办法前附表,请你列出该文件中的形式评审标准和响应性评审标准和资格评审标准,请以json格式返回,外层键名为'形式评审标准'和'响应性评审标准'和'资格评审标准',嵌套键名为'评审因素'中的内容,相应的键值为对应'评审标准'中的内容。"
|
|
|
|
|
results = qianwen_long(file_id, user_query_1)
|
|
|
|
|
original_dict_data = extract_content_from_json(results)
|
2024-09-03 18:04:05 +08:00
|
|
|
|
qualification_review = original_dict_data.pop('资格评审标准', '默认值或None') #qianwen-long有关资格评审的内容
|
2024-09-05 18:00:40 +08:00
|
|
|
|
print(original_dict_data)
|
|
|
|
|
with ThreadPoolExecutor() as executor:
|
|
|
|
|
# 创建Future对象
|
|
|
|
|
future_qualification = executor.submit(process_qualification, qualification_review, truncate3, knowledge_name)
|
|
|
|
|
future_form_response = executor.submit(process_reviews, original_dict_data, knowledge_name, truncate0_jsonpath,
|
2024-09-06 15:50:52 +08:00
|
|
|
|
clause_path,input_file,output_folder)
|
2024-09-05 18:00:40 +08:00
|
|
|
|
|
|
|
|
|
# 等待执行结果
|
|
|
|
|
final_qualify_json = future_qualification.result()
|
|
|
|
|
form_response_dict = future_form_response.result()
|
2024-08-29 16:37:09 +08:00
|
|
|
|
print("形式响应评审done")
|
|
|
|
|
form_response_dict.update(final_qualify_json)
|
|
|
|
|
return nest_json_under_key(form_response_dict,"资格审查")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2024-09-06 15:50:52 +08:00
|
|
|
|
input_file="C:\\Users\\Administrator\\Desktop\\招标文件\\招标test文件夹\\zbtest11.pdf"
|
2024-09-04 17:49:05 +08:00
|
|
|
|
output_folder = "C:\\Users\\Administrator\\Desktop\\招标文件\\招标test文件夹"
|
2024-09-05 18:00:40 +08:00
|
|
|
|
# truncate0 = os.path.join(output_folder, "zbtest20_tobidders_notice_table.pdf")
|
|
|
|
|
truncate2=os.path.join(output_folder,"zbtest20_tobidders_notice.pdf")
|
2024-09-04 17:49:05 +08:00
|
|
|
|
knowledge_name="zbtest20"
|
|
|
|
|
truncate1=os.path.join(output_folder,"zbtest20_evaluation_method.pdf")
|
|
|
|
|
truncate3=os.path.join(output_folder,"zbtest20_qualification.pdf")
|
2024-09-05 18:00:40 +08:00
|
|
|
|
clause_path = convert_clause_to_json(truncate2, output_folder)
|
|
|
|
|
truncate0_jsonpath = os.path.join(output_folder, "truncate_output.json")
|
2024-09-06 15:50:52 +08:00
|
|
|
|
res=combine_review_standards(truncate1,truncate3, knowledge_name,truncate0_jsonpath,clause_path,input_file,output_folder)
|
2024-08-29 16:37:09 +08:00
|
|
|
|
print(res)
|