11.19 五个偏离表

This commit is contained in:
zy123 2024-11-19 17:29:12 +08:00
parent 29ece65259
commit 63476636b7
4 changed files with 1481 additions and 364 deletions

View File

@ -61,8 +61,8 @@ def doubao_model(full_user_query):
print("call doubao...") print("call doubao...")
# 相关参数 # 相关参数
url = "https://ark.cn-beijing.volces.com/api/v3/chat/completions" url = "https://ark.cn-beijing.volces.com/api/v3/chat/completions"
api_key = "ad0c363f-1f23-4b13-aba3-698a4f8c3eb8" api_key = "31dca679-c579-40be-834f-2f13143fd9fa"
model_name = "ep-20241115114052-2clpd" # ep-20241115114052-2clpd 豆包Pro 32k模型 ep-20241117112931-4zb6n 128k model_name = "ep-20241119121710-425g6" # ep-20241119121710-425g6 豆包Pro 32k模型 ep-20241119121743-xt6wg 128k
# 大模型提取页码 # 大模型提取页码
headers = { headers = {

File diff suppressed because it is too large Load Diff

View File

@ -98,7 +98,7 @@ def get_business_requirements(procurement_path):
# final_res.update({key: final_res.get(key, "") for key in required_keys}) # final_res.update({key: final_res.get(key, "") for key in required_keys})
return final_res return final_res
#TODO:改为先判断,再摘取
if __name__ == "__main__": if __name__ == "__main__":
# truncate_file = "C:\\Users\\Administrator\\Desktop\\fsdownload\\e4be098d-b378-4126-9c32-a742b237b3b1\\ztbfile_procurement.docx" # truncate_file = "C:\\Users\\Administrator\\Desktop\\fsdownload\\e4be098d-b378-4126-9c32-a742b237b3b1\\ztbfile_procurement.docx"
truncate_file="D:\\flask_project\\flask_app\\static\\output\\output1\\55dc56f0-f7fe-4734-95a3-867df3456d49\\招招招标文件一中多媒体报告厅教学设备_procurement.docx" truncate_file="D:\\flask_project\\flask_app\\static\\output\\output1\\55dc56f0-f7fe-4734-95a3-867df3456d49\\招招招标文件一中多媒体报告厅教学设备_procurement.docx"

View File

@ -424,24 +424,24 @@ def combine_qualification_review(invalid_path, qualification_path, notice_path):
1.请以json格式给出外层为'资格性审查'最内层的值需要用列表包裹 1.请以json格式给出外层为'资格性审查'最内层的值需要用列表包裹
2.一层嵌套内的键需要总结分类为某类评审因素 2.一层嵌套内的键需要总结分类为某类评审因素
3.你的回答要与原文完全一致不要回答有关符合性审查的内容 3.你的回答要与原文完全一致不要回答有关符合性审查的内容
4.仔细检查你所选取的标准若发现这些标准实际上是在描述不允许出现的资格性审查情况则将外键替换为'资格性审查(以下出现)'并将这些标准写入其中 4.仔细检查你所选取的标准若发现这些标准实际上是在描述不允许出现的资格性审查情况则将外键替换为'资格性审查(以下情况不得出现)'并将这些标准写入其中
5.最大细分为二层嵌套即可 5.最大细分为二层嵌套即可
输出示例1 输出示例1
{ {
"资格性审查": { #一层嵌套 "资格性审查": { #一层嵌套
"某类评审因素": [ #二层嵌套 "某类评审因素": [ #二层嵌套
"1.因素1", "因素1",
"2.因素2" "因素2"
] ]
... ...
} }
} }
输出示例2 输出示例2
{ {
"资格性审查(以下出现)": { #若发现文中出现均为反向标准,用像该示例一样的处理 "资格性审查(以下情况不得出现)": { #若发现文中出现均为反向标准,用像该示例一样的处理
"某类不允许的评审因素": [ #二层嵌套 "某类不允许的评审因素": [ #二层嵌套
"1.因素1", "因素1",
"2.因素2" "因素2"
] ]
... ...
} }
@ -456,24 +456,24 @@ def combine_qualification_review(invalid_path, qualification_path, notice_path):
1.请以json格式给出外层为'符合性审查'最内层的值需要用列表包裹 1.请以json格式给出外层为'符合性审查'最内层的值需要用列表包裹
2.一层嵌套内的键需要总结分类为某类评审因素 2.一层嵌套内的键需要总结分类为某类评审因素
3.你的回答要与原文完全一致也不要回答有关资格性审查的内容 3.你的回答要与原文完全一致也不要回答有关资格性审查的内容
4.仔细检查你所选取的标准若发现这些标准实际上是在描述不允许出现的符合性审查情况则将外键替换为'符合性审查(以下出现)'并将这些标准写入其中 4.仔细检查你所选取的标准若发现这些标准实际上是在描述不允许出现的符合性审查情况则将外键替换为'符合性审查(以下情况不得出现)'并将这些标准写入其中
5.最大细分为二层嵌套即可 5.最大细分为二层嵌套即可
输出示例1 输出示例1
{ {
"符合性审查": { #一层嵌套 "符合性审查": { #一层嵌套
"某类评审因素": [ #二层嵌套 "某类评审因素": [ #二层嵌套
"1.因素1", "因素1",
"2.因素2" "因素2"
] ]
... ...
} }
} }
输出示例2 输出示例2
{ {
"符合性审查(以下出现)": { #若发现文中出现均为反向标准,用像该示例一样的处理 "符合性审查(以下情况不得出现)": { #若发现文中出现均为反向标准,用像该示例一样的处理
"某类不允许的评审因素": [ #二层嵌套 "某类不允许的评审因素": [ #二层嵌套
"1.因素1", "因素1",
"2.因素2" "因素2"
] ]
... ...
} }
@ -545,13 +545,23 @@ def combine_qualification_review(invalid_path, qualification_path, notice_path):
detailed_res[key] = result detailed_res[key] = result
# 定义所需的顺序 # 定义所需的顺序
desired_order = ["申请人资格要求", "资格性审查", "符合性审查"] desired_order = [
"申请人资格要求",
["资格性审查", "资格性审查(以下情况不得出现)"],
["符合性审查", "符合性审查(以下情况不得出现)"]
]
# print(json.dumps(detailed_res,ensure_ascii=False,indent=4)) # print(json.dumps(detailed_res,ensure_ascii=False,indent=4))
# 创建一个新的有序字典 # 创建一个新的有序字典
ordered_res = {} ordered_res = {}
for key in desired_order: for item in desired_order:
if key in detailed_res: if isinstance(item, list):
ordered_res[key] = detailed_res[key] for key in item:
if key in detailed_res:
ordered_res[key] = detailed_res[key]
break # 只添加第一个匹配的键,"资格性审查"和 "资格性审查(以下情况不得出现)"互斥
else:
if item in detailed_res:
ordered_res[item] = detailed_res[item]
# 将重新排序后的字典传递给处理函数 # 将重新排序后的字典传递给处理函数
processed_data = process_dict(preprocess_dict(ordered_res)) processed_data = process_dict(preprocess_dict(ordered_res))