1.2 修改bug
This commit is contained in:
parent
4abc4b761f
commit
308845ac45
@ -187,17 +187,23 @@ def combine_evaluation_standards(evaluation_method_path,invalid_path,zb_type):
|
||||
-若评分部分包含附加信息(如大项评分的整体要求,未直接归属于具体评分项),需添加一个 备注 键,值为该附加信息。
|
||||
|
||||
要求与指南:
|
||||
1. 请首先定位评分细则的表格,不要回答有关资格审查的内容,也不要从评标办法正文中提取回答
|
||||
2. 若表格中商务和技术评分混合一起,请根据你对招投标业务的熟悉,对实际表格内容的评分因素进行准确分类,归类至商务评分或技术评分。
|
||||
3. 若表中的评分大项不是这三个,请你根据语义及你对招投标业务的熟悉,分别映射到'技术评分'、'商务评分'、'投标报价评分',而不必严格按照表格中的名称。
|
||||
|
||||
1. 请首先定位评分表,不要回答有关资格审查、符合审查的内容,也不要从评标办法正文中提取回答。
|
||||
2. 若表中的评分大项不是这三个,或者有额外的评分大项:
|
||||
-请你根据语义及你对招投标业务的熟悉,分别映射到'技术评分'、'商务评分'、'投标报价评分',而不必按照表格中大项名称。
|
||||
-映射关系可以是“一对一”或“多对一”,例如两个评分大项可以同时归类到“技术评分”。关键是不遗漏表中的评分大项,确保每个大项都被映射。
|
||||
若表中只有评分因素而无评分大项:
|
||||
-请将评分因素正确地归类到'技术评分'、'商务评分'、'投标报价评分',不要遗漏任何一个评分因素。
|
||||
3. 若表格中商务和技术评分混合一起,或者有部分评分因素无法通过表格结构明确归类:
|
||||
-请根据你对招投标业务的熟悉,对表格中的评分因素进行准确分类。关键是确保每个评分因素都能被归类到'技术评分'或'商务评分'或'投标报价评分',不要遗漏任何一个评分因素。
|
||||
特殊情况:
|
||||
1. 最外层键名为各大评分项;但是如果该招标、采购活动有多个分包,则最外层键名为对应的包名,如'一包',内部格式不变。
|
||||
2. 若大项的'xx评分'要求未在文中说明,则键名'xx评分'的键值设为字符串'本项目无xx评分项',例如"技术评分":"本项目无技术评分项",而非默认的字典格式。
|
||||
3. 默认情况大项评分仅有'技术评分''商务评分''投标报价评分',若在充分归类之后,表格中仍有评分因素未被归类,才添加大项评分'其他'保存该内容。
|
||||
|
||||
禁止内容:
|
||||
1. 确保所有输出内容均基于提供的实际招标文件内容(除了最外层的三个评分大项名称),不使用任何预设的示例作为回答。
|
||||
2. 不得擅自添加不属于评审因素的键名以及 `'备注'` 之外的其他键名。
|
||||
3. 不得遗漏评分表中的任何评分因素,确保每个评分因素都被正确归类到评分大项下。
|
||||
|
||||
以下为示例输出,仅供格式参考:
|
||||
{
|
||||
@ -279,16 +285,21 @@ def combine_evaluation_standards(evaluation_method_path,invalid_path,zb_type):
|
||||
禁止将同个单元格内的内容拆分至多个字典中;禁止遗漏单元格内任何信息,包括注的内容。
|
||||
|
||||
3.备注信息:
|
||||
-若评分部分包含附加信息(如大项评分的整体要求,未直接归属于具体评分项),需添加一个 备注 键,值为该附加信息。
|
||||
-若评分部分包含附加信息(如大项评分的整体要求,未直接归属于具体评分项),需添加一个 '备注' 键,值为该附加信息。
|
||||
|
||||
要求与指南:
|
||||
1. 请首先定位评分细则的表格,不要回答有关资格审查的内容,也不要从评标办法正文中提取回答
|
||||
2. 若表格中商务和技术评分混合一起,请根据你对招投标业务的熟悉,对实际表格内容的评分因素进行准确分类,归类至商务评分或技术评分。
|
||||
3. 若表中的评分大项不是这三个,请你根据语义及你对招投标业务的熟悉,分别映射到'技术评分'、'商务评分'、'投标报价评分',而不必严格按照表格中的名称。
|
||||
|
||||
1. 请首先定位评分表,不要回答有关资格审查、符合审查的内容,也不要从评标办法正文中提取回答。
|
||||
2. 若表中的评分大项不是这三个,或者有额外的评分大项:
|
||||
-请你根据语义及你对招投标业务的熟悉,分别映射到'技术评分'、'商务评分'、'投标报价评分',而不必按照表格中大项名称。
|
||||
-映射关系可以是“一对一”或“多对一”,例如两个评分大项可以同时归类到“技术评分”。关键是不遗漏表中的评分大项,确保每个大项都被映射。
|
||||
若表中只有评分因素而无评分大项:
|
||||
-请将评分因素正确地归类到'技术评分'、'商务评分'、'投标报价评分',不要遗漏任何一个评分因素。
|
||||
3. 若表格中商务和技术评分混合一起,或者有部分评分因素无法通过表格结构明确归类:
|
||||
-请根据你对招投标业务的熟悉,对表格中的评分因素进行准确分类。关键是确保每个评分因素都能被归类到'技术评分'或'商务评分'或'投标报价评分',不要遗漏任何一个评分因素。
|
||||
特殊情况:
|
||||
1. 最外层键名为各大评分项;但是如果该招标、采购活动有多个分包,则最外层键名为对应的包名,如'一包',内部格式不变。
|
||||
2. 2. 若大项的'xx评分'要求未在文中说明,则键名'xx评分'的键值设为字符串'本项目无xx评分项',例如"技术评分":"本项目无技术评分项",而非默认的字典格式。
|
||||
2. 若大项的'xx评分'要求未在文中说明,则键名'xx评分'的键值设为字符串'本项目无xx评分项',例如"技术评分":"本项目无技术评分项",而非默认的字典格式。
|
||||
3. 默认情况大项评分仅有'技术评分''商务评分''投标报价评分',若在充分归类之后,表格中仍有评分因素未被归类,才添加大项评分'其他'保存该内容。
|
||||
|
||||
禁止内容:
|
||||
1. 确保所有输出内容均基于提供的实际招标文件内容(除了最外层的三个评分大项名称),不使用任何预设的示例作为回答。
|
||||
@ -363,6 +374,7 @@ def combine_evaluation_standards(evaluation_method_path,invalid_path,zb_type):
|
||||
else:
|
||||
evaluation_res = qianwen_long(file_id, user_query,2,1,True) # 有些重复的键名,只有qianwen_long_text能保留
|
||||
message = evaluation_res[0]
|
||||
# print(message)
|
||||
total_tokens = evaluation_res[1]
|
||||
# print(evaluation_res)
|
||||
# 清理和处理响应
|
||||
@ -441,13 +453,13 @@ def combine_evaluation_standards(evaluation_method_path,invalid_path,zb_type):
|
||||
if __name__ == "__main__":
|
||||
start_time=time.time()
|
||||
# truncate_file=r"C:\Users\Administrator\Desktop\招标文件-采购类\tmp2\2024-新疆-塔城地区公安局食药环分局快检实验室项目_evaluation_method.pdf"
|
||||
evaluation_method_path = r'C:\Users\Administrator\Desktop\文件解析问题\文件解析问题\82a6f11d-cfcd-4cb4-93e9-940fa24abb21\ztbfile_evaluation_method.pdf'
|
||||
evaluation_method_path = r'C:\Users\Administrator\Desktop\招标文件\招标04_evaluation_method.pdf'
|
||||
invalid_path=r'C:\Users\Administrator\Desktop\文件解析问题\文件解析问题\1414cb9c-7bf4-401c-8761-2acde151b9c2\ztbfile.docx'
|
||||
# truncate_file = "C:\\Users\\Administrator\\Desktop\\货物标\\output2\\2-招标文件(统计局智能终端二次招标)_evaluation_method.pdf"
|
||||
# truncate_file="C:\\Users\\Administrator\\Desktop\\货物标\\output2\\广水市妇幼招标文件最新(W改)_evaluation_method.pdf"
|
||||
# truncate_file = "C:\\Users\\Administrator\\Desktop\\fsdownload\\2d481945-1f82-45a5-8e56-7fafea4a7793\\ztbfile_evaluation_method.pdf"
|
||||
# truncate_file="C:\\Users\\Administrator\\Desktop\\fsdownload\\ztbfile_evaluation_method.pdf"
|
||||
res = combine_evaluation_standards(evaluation_method_path,invalid_path,2)
|
||||
res = combine_evaluation_standards(evaluation_method_path,invalid_path,1)
|
||||
print(json.dumps(res, ensure_ascii=False, indent=4))
|
||||
end_time=time.time()
|
||||
print("elapsed time:"+str(end_time-start_time))
|
@ -116,13 +116,13 @@ if __name__ == "__main__":
|
||||
# pdf_path=r"C:\Users\Administrator\Desktop\货物标\zbfiles\094定稿-湖北工业大学轻武器模拟射击设备采购项目招标文件.pdf"
|
||||
# pdf_path = r"C:\Users\Administrator\Desktop\货物标\zbfiles\zbtest4_evaluation_method.pdf"
|
||||
# pdf_path = r"C:\Users\Administrator\Desktop\招标文件\招标02.pdf"
|
||||
pdf_path=r'C:\Users\Administrator\Desktop\new招标文件\货物标\HBDL-2024-0158-001-招标文件.pdf'
|
||||
pdf_path=r'C:\Users\Administrator\Desktop\货物\test2\2020-安徽-安徽省生态环境厅电梯采购.pdf'
|
||||
# input_path=r"C:\Users\Administrator\Desktop\招标文件\招标test文件夹\zbtest8.pdf"
|
||||
output_folder = r"C:\Users\Administrator\Desktop\fsdownload\91399aa4-1ee8-447d-a05b-03cd8d15ced5\tmp"
|
||||
output_folder = r"C:\Users\Administrator\Desktop\货物\test"
|
||||
# selections = [1, 4] # 仅处理 selection 4、1
|
||||
selections = [1, 2, 3, 5]
|
||||
files = truncate_pdf_multiple(pdf_path, output_folder, logger, 'goods', selections)
|
||||
# files = truncate_pdf_multiple(pdf_path, output_folder, logger, 'goods')
|
||||
# selections = [1, 2, 3, 5]
|
||||
# files = truncate_pdf_multiple(pdf_path, output_folder, logger, 'goods', selections)
|
||||
files = truncate_pdf_multiple(pdf_path, output_folder, logger, 'goods')
|
||||
print(files)
|
||||
# print(files[-1])
|
||||
# print(files[-2])
|
||||
|
@ -41,12 +41,12 @@ def check_pdf_pages(pdf_path,mode, logger):
|
||||
num_pages = len(reader.pages)
|
||||
logger.info(f"PDF '{pdf_path}' 的总页数为: {num_pages}")
|
||||
if num_pages <= 30:
|
||||
logger.info("PDF页数小于或等于50页,跳过切分逻辑。")
|
||||
logger.info("PDF(invalid_path)页数小于或等于30页,跳过切分逻辑。")
|
||||
if mode=='goods':
|
||||
return True,['', '', '', '', '', '', pdf_path,'']
|
||||
else:
|
||||
return True,['', '', '', '', '', pdf_path, '']
|
||||
# 若页数大于50页,返回None表示继续处理
|
||||
# 若页数大于30页,返回None表示继续处理
|
||||
return False, []
|
||||
except Exception as e:
|
||||
logger.error(f"无法读取 PDF 页数: {e}")
|
||||
@ -170,8 +170,10 @@ def get_invalid_file(file_path, output_folder, common_header,begin_page):
|
||||
# 打开PDF文件
|
||||
pdf_document = PdfReader(file_path)
|
||||
total_pages = len(pdf_document.pages)
|
||||
# print(f"PDF总页数: {total_pages}")
|
||||
|
||||
# 新增逻辑:如果总页数 <= 50,直接返回 file_path
|
||||
if total_pages <= 50:
|
||||
print(f"PDF页数({total_pages}) <= 50,直接返回文件路径:{file_path}")
|
||||
return file_path
|
||||
# 提取并清理每页的文本内容
|
||||
page_texts = []
|
||||
for i in range(total_pages):
|
||||
@ -239,7 +241,7 @@ def get_invalid_file(file_path, output_folder, common_header,begin_page):
|
||||
# 验证页码范围
|
||||
if start_page > end_page:
|
||||
print(f"无效的页码范围: 起始页 ({start_page + 1}) > 结束页 ({end_page + 1})")
|
||||
return [""]
|
||||
return ""
|
||||
|
||||
# 调用已实现的保存函数
|
||||
output_path = save_extracted_pages(
|
||||
|
@ -1,6 +1,7 @@
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import regex
|
||||
import time
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from flask_app.general.doubao import doubao_model, generate_full_user_query
|
||||
@ -63,7 +64,7 @@ def read_tables_from_docx(file_path):
|
||||
# 遍历每一行中的单元格
|
||||
for cell in row.cells:
|
||||
cell_text = cell.text.strip() # 去除单元格内容前后空白
|
||||
if len(cell_text) > 8: # 检查文字数量是否大于5
|
||||
if len(cell_text) > 8: # 检查文字数量是否大于8
|
||||
cell_contents.append(cell_text)
|
||||
|
||||
# 返回符合条件的单元格内容
|
||||
@ -127,8 +128,13 @@ def preprocess_paragraphs(paragraphs):
|
||||
text = paragraphs[i].text.strip()
|
||||
except AttributeError:
|
||||
continue # 如果段落对象没有 text 属性,跳过
|
||||
if text and not pattern_marker.search(text):
|
||||
return text, i
|
||||
# 跳过空白段落和页面标记
|
||||
if not text or pattern_marker.search(text):
|
||||
continue
|
||||
# 跳过匹配排除模式的段落
|
||||
if (pattern_numbered.match(text) or pattern_parentheses.match(text)) and len(text) < 8:
|
||||
continue
|
||||
return text, i
|
||||
return '', -1
|
||||
|
||||
while index < len(paragraphs):
|
||||
@ -201,6 +207,8 @@ def preprocess_paragraphs(paragraphs):
|
||||
else:
|
||||
if flag:
|
||||
# 当前段落不以数字序号开头,且 flag 为 True
|
||||
if "供应商公章" in current_text:
|
||||
print("yes")
|
||||
if not list_item_pattern.match(current_text):
|
||||
if processed:
|
||||
# **新增逻辑开始**
|
||||
@ -352,13 +360,7 @@ def extract_text_with_keywords(doc_path, keywords, follow_up_keywords):
|
||||
def match_keywords(text, patterns):
|
||||
# 首先检查关键词是否匹配
|
||||
for pattern in patterns:
|
||||
match = re.search(pattern, text, re.IGNORECASE)
|
||||
if match:
|
||||
# 如果当前的模式是 '不\s*得',则额外检查是否匹配 '不得分'
|
||||
if '不\s*得' in pattern: # 使用字符串匹配检查模式
|
||||
post_match_text = text[match.end():].strip()
|
||||
if post_match_text.startswith("分"):
|
||||
continue # 如果是"不得分",跳过这个匹配
|
||||
if re.search(pattern, text, re.IGNORECASE):
|
||||
return True
|
||||
return False
|
||||
|
||||
@ -542,7 +544,7 @@ def clean_dict_datas(extracted_contents, keywords, excludes): # 让正则表达
|
||||
|
||||
|
||||
#从表格中提取数据
|
||||
def extract_table_with_keywords(data, keywords, follow_up_keywords):
|
||||
def extract_table_with_keywords(data, keywords, follow_up_keywords,flag=False):
|
||||
"""遍历列表中的每个元素,查找并返回包含关键词的句子列表,并根据是否存在后续关键词分别存储到两个列表中。"""
|
||||
sentences1 = [] # 保存没有后续关键词的情况
|
||||
sentences2 = [] # 保存有后续关键词的情况
|
||||
@ -578,11 +580,11 @@ def extract_table_with_keywords(data, keywords, follow_up_keywords):
|
||||
item_with_placeholders = bracket_pattern.sub(replace_bracket_content, item)
|
||||
|
||||
# 2. 分割句子,保证句子完整性(按标点符号和序号分割)
|
||||
split_sentences = re.split(
|
||||
split_sentences = regex.split(
|
||||
r'(?<=[。!?!?\?])|' # 在中文句号、感叹号、问号或分号后面分割
|
||||
r'(?=\d+(?:[..]\d+)+)(?!\s*[号条款节章项例页段部步点年月日时分秒个元千万])|' # 在类似1.1 1.1.1 的数字序号前分割
|
||||
r'(?=\d+\s(?!\s*[号条款节章项例页段部步点年月日时分秒个元千万]))|' # 数字后面跟空格且空格后面不是指定关键字时分割
|
||||
r'(?=\d+[、..])(?!\s*[号条款节章项例页段部步点年月日时分秒个元千万])|' # 在数字后直接跟顿号、半角点号或全角点号时分割
|
||||
r'(?<![+\-×÷*/]\s*|\d)(?=\d+\s(?!\s*[号条款节章项例页段部步点年月日时分秒个元千万]))|' # 数字后面跟空格且空格后面不是指定关键字,且前面不是运算符和空格或数字
|
||||
r'(?<![+\-×÷*/]\s*|\d)(?=\d+[、..])(?!\s*[号条款节章项例页段部步点年月日时分秒个元千万])|' # 数字后直接跟顿号、半角点号或全角点号,且前面不是运算符和空格或数字
|
||||
r'(?=[A-Za-z][..]\s*)|' # 在字母加点(如A.、a.)前分割
|
||||
r'(?=[A-Za-z]+\s*\d+\s*(?:[..]\s*\d+)*)|' # 在可选字母加数字或多级编号前分割
|
||||
r'(?=[一二三四五六七八九十]+、)', # 在中文数字加顿号(如一、二、)前分割
|
||||
@ -595,17 +597,13 @@ def extract_table_with_keywords(data, keywords, follow_up_keywords):
|
||||
|
||||
# 接下来是处理包含和不包含后续关键词的情况
|
||||
i = 0
|
||||
# 清洗模式
|
||||
clean_pattern = r'^\s*(?:[((]\s*\d+\s*[)))]|[A-Za-z]?\d+(?:\.\s*\d+)*[\s\.、.)\)]+|[一二三四五六七八九十]+、|[A-Z][))\.、.]?\s*)'
|
||||
while i < len(split_sentences):
|
||||
sentence = split_sentences[i].strip()
|
||||
if keywords_pattern.search(sentence):
|
||||
# 处理 "不\s*得" 的特殊情况,跳过包含 "不得分" 的句子
|
||||
not_allowed_match = re.search(r'不\s*得', sentence, re.IGNORECASE)
|
||||
if not_allowed_match:
|
||||
post_match_text = sentence[not_allowed_match.end():].strip()
|
||||
if post_match_text.startswith("分"):
|
||||
i += 1 # 跳过这个句子
|
||||
continue
|
||||
|
||||
# 如果匹配关键词
|
||||
if keywords_pattern.search(sentence):
|
||||
# 检查是否存在后续关键词
|
||||
follow_up_present = any(fp.search(sentence) for fp in follow_up_patterns)
|
||||
if follow_up_present:
|
||||
@ -623,18 +621,55 @@ def extract_table_with_keywords(data, keywords, follow_up_keywords):
|
||||
else:
|
||||
full_text = ' '.join(split_sentences[start_index:]).strip()
|
||||
|
||||
# 清洗文本,去除前缀编号等
|
||||
|
||||
pattern = r'^\s*(?:[((]\s*\d+\s*[)))]|[A-Za-z]?\d+(?:\.\s*\d+)*[\s\.、.)\)]+|[一二三四五六七八九十]+、|[A-Z][))\.、.]?\s*)'
|
||||
full_text = re.sub(pattern, '', full_text).replace(' ', '').strip()
|
||||
full_text = re.sub(clean_pattern, '', full_text).replace(' ', '').strip()
|
||||
sentences2.append(full_text) # 存储有后续关键词的情况
|
||||
i = end_index if found_next_section else len(split_sentences)
|
||||
else:
|
||||
# 没有后续关键词的情况
|
||||
pattern = r'^\s*(?:[((]\s*\d+\s*[)))]|[A-Za-z]?\d+(?:\.\s*\d+)*[\s\.、.)\)]+|[一二三四五六七八九十]+、|[A-Z][))\.、.]?\s*)'
|
||||
cleaned_sentence = re.sub(pattern, '', sentence).replace('\n', '').replace(' ', '').strip()
|
||||
if len(cleaned_sentence) > 8:
|
||||
sentences1.append(cleaned_sentence) # 存储没有后续关键词的情况
|
||||
if flag:
|
||||
# 当 flag=True 时,简化逻辑,直接添加清洗后的句子
|
||||
# 清洗文本
|
||||
cleaned_sentence = re.sub(clean_pattern, '', sentence).replace('\n', '').replace(' ', '').strip()
|
||||
if len(cleaned_sentence) > 8:
|
||||
sentences1.append(cleaned_sentence)
|
||||
else:
|
||||
# 如果 \n 换行符前面满足匹配,如 '无效投标\n',那么不删该 \n
|
||||
sentence = re.sub(fr'({keywords})(\s*\n)', r'\1[换行标记]', sentence)
|
||||
|
||||
# 清洗文本
|
||||
cleaned_sentence = re.sub(clean_pattern, '', sentence).replace('\n', '').replace(' ', '').strip()
|
||||
|
||||
# 恢复保留的换行符
|
||||
cleaned_sentence = cleaned_sentence.replace('[换行标记]', '\n')
|
||||
|
||||
# 检查匹配次数和是否需要切分
|
||||
matches = list(keywords_pattern.finditer(sentence))
|
||||
if len(matches) >= 2: # 如果匹配了两处及以上
|
||||
split_points = []
|
||||
for match in matches:
|
||||
start, end = match.span()
|
||||
print(sentence[end:end + 6])
|
||||
if sentence[end:end + 6] == "[换行标记]":
|
||||
split_points.append(end)
|
||||
|
||||
if len(split_points) >= 1: # 至少有一个有效切分点
|
||||
split_index = split_points[0] # 取第一个切分点
|
||||
part1 = sentence[:split_index].replace("[换行标记]", "\n").strip()
|
||||
part2 = sentence[split_index:].replace("[换行标记]", "\n").strip()
|
||||
# 对 part1 和 part2 进行清洗
|
||||
part1 = re.sub(clean_pattern, '', part1).replace('\n', '').replace(' ', '').strip()
|
||||
part2 = re.sub(clean_pattern, '', part2).replace('\n', '').replace(' ', '').strip()
|
||||
sentences1.append(part1) # 将前半部分加入结果
|
||||
sentences1.append(part2) # 将后半部分加入结果
|
||||
else:
|
||||
# 如果没有足够的有效切分点,直接保留完整句子
|
||||
if len(cleaned_sentence) > 8:
|
||||
sentences1.append(cleaned_sentence)
|
||||
else:
|
||||
# 如果只有一个匹配点或不足两处匹配
|
||||
if len(cleaned_sentence) > 8:
|
||||
sentences1.append(cleaned_sentence)
|
||||
|
||||
i += 1
|
||||
else:
|
||||
i += 1
|
||||
@ -681,17 +716,17 @@ def handle_query(file_path, user_query, output_file, result_key, keywords):
|
||||
follow_up_keywords = [
|
||||
r'情\s*形\s*之\s*一',
|
||||
r'情\s*况\s*之\s*一',
|
||||
r'下\s*列',
|
||||
r'以\s*下',
|
||||
r'下\s*列(?!\s*公式)', # 增加负向前瞻,排除“下列公式”
|
||||
r'以\s*下(?!\s*公式)', # 增加负向前瞻,排除“以下公式”
|
||||
r'其\s*他.*?情\s*形\s*[::]',
|
||||
r'包\s*括'
|
||||
]
|
||||
extracted_contents = extract_text_with_keywords(file_path, [keywords], follow_up_keywords) # 字典结果
|
||||
|
||||
all_texts1, all_texts2 = clean_dict_datas(extracted_contents, keywords, excludes) # 列表
|
||||
|
||||
# table_data_list=read_docx_last_column(file_path) #从投标人须知前附表中提取信息生成列表data,每个元素为'一行信息'
|
||||
table_data_list = read_tables_from_docx(file_path)
|
||||
# print(table_data_list)
|
||||
all_tables1, all_tables2 = extract_table_with_keywords(table_data_list, keywords, follow_up_keywords)
|
||||
qianwen_txt = all_texts1 + all_tables1
|
||||
# Proceed only if there is content to write
|
||||
@ -702,28 +737,35 @@ def handle_query(file_path, user_query, output_file, result_key, keywords):
|
||||
with open(output_file, 'w', encoding='utf-8') as file:
|
||||
counter = 1
|
||||
for content in qianwen_txt:
|
||||
file.write(f"{counter}. {content}\n")
|
||||
file.write("..............." + '\n')
|
||||
counter += 1
|
||||
# 使用内容的前25个字符作为去重的依据
|
||||
key = content[:25] # 提取前25个字符
|
||||
if key not in seen_contents: # 如果前30个字符未出现过
|
||||
file.write(f"{counter}. {content}\n")
|
||||
file.write("..............." + '\n')
|
||||
seen_contents.add(key) # 标记前30个字符为已写入
|
||||
counter += 1
|
||||
|
||||
# 生成用户查询
|
||||
user_query = generate_full_user_query(output_file, user_query)
|
||||
model_ans = doubao_model(user_query) # 豆包模型
|
||||
model_ans = doubao_model(user_query) # 豆包模型返回结果
|
||||
# file_id = upload_file(output_file)
|
||||
# model_ans = qianwen_long(file_id, user_query)
|
||||
num_list = process_string_list(model_ans)
|
||||
num_list = process_string_list(model_ans) # 处理模型返回的序号
|
||||
print(result_key + "选中的序号:" + str(num_list))
|
||||
|
||||
for index in num_list:
|
||||
if 1 <= index <= len(qianwen_txt):
|
||||
content = qianwen_txt[index - 1]
|
||||
if content not in seen_contents:
|
||||
selected_contents.append(content)
|
||||
seen_contents.add(content)
|
||||
# 直接添加到 selected_contents,因为前面已经按前30字符去重
|
||||
selected_contents.append(content)
|
||||
|
||||
# 无论 qianwen_txt 是否为空,都添加 all_texts2 和 all_tables2 的内容
|
||||
for item in all_texts2 + all_tables2:
|
||||
if item not in seen_contents:
|
||||
# 同样使用前25个字符判断去重
|
||||
key = item[:25] # 提取前30个字符
|
||||
if key not in seen_contents:
|
||||
selected_contents.append(item)
|
||||
seen_contents.add(item)
|
||||
seen_contents.add(key)
|
||||
|
||||
# 如果 selected_contents 不为空,则返回结果,否则返回空字符串
|
||||
if selected_contents:
|
||||
@ -750,20 +792,26 @@ def combine_find_invalid(invalid_docpath, output_dir):
|
||||
r'否\s*决|'
|
||||
r'无\s*效\s*投\s*标|'
|
||||
r'无\s*效\s*文\s*件|'
|
||||
r'(?:文\s*件|投\s*标)\s*[\u4e00-\u9fa5]?\s*(?:无|失)\s*效|'
|
||||
r'(?:文\s*件|投\s*标|响\s*应)\s*[\u4e00-\u9fa5]?\s*(?:无|失)\s*效|'
|
||||
r'无\s*效\s*响\s*应|'
|
||||
r'无\s*效\s*报\s*价|'
|
||||
r'无\s*效\s*标|'
|
||||
r'视\s*为\s*无\s*效|'
|
||||
r'被\s*拒\s*绝|'
|
||||
r'将\s*拒\s*绝|'
|
||||
r'予\s*以\s*拒\s*绝',
|
||||
"""以下是从招标文件中摘取的内容,文本内信息之间以...............分割。
|
||||
请根据该内容回答以下问题:
|
||||
否决投标、拒绝投标、无效投标或投标失效的情况有哪些?
|
||||
"""以下是从招标文件中摘取的内容,文本中序号分明,各信息之间以...............分割。
|
||||
任务目标:
|
||||
从文本中筛选所有描述否决投标,拒绝投标,投标、响应无效或类似表述的情况,并返回对应的序号。
|
||||
要求与指南:
|
||||
文本中可能存在无关的信息,请准确筛选符合条件的信息,并将符合条件的信息的序号返回。
|
||||
若存在语义相同或重复的情况,只需返回其中一个序号。
|
||||
请以[x, x, x]格式返回结果,其中x为符合的信息的序号;若没有符合的情况,请返回[]。
|
||||
输出格式:
|
||||
以 [x, x, x] 的形式返回,x 为符合条件的信息的序号。
|
||||
如果文本中没有符合条件的信息,请返回 []。
|
||||
特殊情况:
|
||||
如果某序号的内容明显分为几部分且一部分内容符合筛选条件,但其他部分明显是无关内容,请返回符合部分的字符串内容代替序号。
|
||||
示例输出,仅供格式参考:
|
||||
[1,3,4,6]
|
||||
文本内容:{full_text}
|
||||
""",
|
||||
os.path.join(output_dir, "temp1.txt"),
|
||||
@ -771,34 +819,41 @@ def combine_find_invalid(invalid_docpath, output_dir):
|
||||
),
|
||||
(
|
||||
r'废\s*标',
|
||||
"""以下是从招标文件中摘取的内容,文本内之间的信息以'...............'分割。
|
||||
请根据该内容回答以下问题:
|
||||
废标项的情况有哪些?
|
||||
"""以下是从招标文件中摘取的内容,文本中序号分明,文本内之间的信息以'...............'分割。
|
||||
任务目标:
|
||||
请根据以下内容,筛选出 废标项的情况 (明确描述导致 废标 的情况)并返回对应的序号。
|
||||
要求与指南:
|
||||
文本中可能存在无关的信息,请准确筛选符合条件的信息,并将符合条件的信息的序号返回。
|
||||
若存在语义相同或重复的情况,只需返回其中一个序号。
|
||||
请以[x, x, x]格式返回结果,其中x为符合的信息的序号;若没有符合的情况,请返回[]。
|
||||
输出格式:
|
||||
返回结果以 [x, x, x] 的形式,其中 x 为符合条件的信息的序号。
|
||||
如果文本中没有任何符合条件的废标情况,请返回 []。
|
||||
示例输出,仅供格式参考:
|
||||
[1,3,4,6]
|
||||
文本内容:{full_text}
|
||||
""",
|
||||
os.path.join(output_dir, "temp2.txt"),
|
||||
"废标项"
|
||||
),
|
||||
(
|
||||
r'不\s*得|禁\s*止\s*投\s*标',
|
||||
"""以下是从招标文件中摘取的内容,文本内之间的信息以'...............'分割,每条信息规定了各方不得存在的情形。请根据以下要求进行筛选:
|
||||
r'不\s*得(?!\s*分)|禁\s*止\s*投\s*标',
|
||||
"""以下是从招标文件中摘取的内容,文本中序号分明,文本内的条款以'...............'分割。每条条款规定了各方不得存在的情形。请根据以下要求进行筛选:
|
||||
**筛选要求**:
|
||||
1. **仅筛选**出主语为“投标人”、“中标人”、“供应商”、“联合体投标各方”或“磋商小组”或其他投标相关主体的条款。
|
||||
2. **排除**主语为“招标人”、“采购人”、“评标委员会”或其他非投标相关主体的条款。
|
||||
3. **仅包含**明确描述禁止情形的条款,不包含笼统或未具体说明情形的条款。若信息内容诸如'投标人不得存在的其他关联情形'这样笼统的内容,而未说明具体的情形,则无需添加这条信息。
|
||||
1. **仅包含**明确描述投标主体禁止情形的条款,不包含笼统或未具体说明情形的条款。若条款内容诸如'投标人不得存在的其他关联情形'这样笼统的内容,而未说明具体的情形,则无需添加这条条款。
|
||||
2. **仅筛选**出主语为“投标人”、“中标人”、“供应商”、“联合体投标各方”或其他投标相关主体的条款,**或**描述的情形针对投标相关主体的条款。
|
||||
3. **排除**主语为“招标人”、“采购人”、“评标委员会”或其他非投标相关主体的条款。
|
||||
4. **特殊情况**:如果条款中包含“磋商小组”,且在语境中“磋商小组”指代或包含“投标方”,则应将其考虑在内;否则,排除该条款。
|
||||
|
||||
**输出格式**:
|
||||
返回结果以 [x, x, x] 的形式,其中 x 为符合条件的条款的序号。
|
||||
如果没有符合条件的条款,返回 `[]`。
|
||||
**示例**:
|
||||
- **符合条件**:
|
||||
- `1. 投标人不得...` → 包含,返回序号 1。
|
||||
- `6. 联合体投标各方不得...` → 包含,返回序号 6。
|
||||
- `3. 联合体投标各方不得...` → 包含,返回序号 3。
|
||||
- **不符合条件**:
|
||||
- `14. 采购人不得...` → 主语为“采购人”,排除。
|
||||
|
||||
请根据上述筛选要求,阅读以下文本内容,并以 `[x,x,x]` 格式返回符合条件的条款序号,如果没有符合条件的条款,返回 `[]`。
|
||||
- `2. 采购人不得...` → 主语为“采购人”,排除。
|
||||
-示例输出: [1,3]
|
||||
请根据上述筛选要求,阅读以下文本内容,并返回符合条件的条款序号,
|
||||
|
||||
文本内容:{full_text}
|
||||
""",
|
||||
@ -838,7 +893,7 @@ def combine_find_invalid(invalid_docpath, output_dir):
|
||||
print("无效标与废标done...")
|
||||
return {"无效标与废标项": combined_dict}
|
||||
|
||||
#TODO:preprocess测试一下有无问题
|
||||
#TODO:添加到txt中也要做一个去重。
|
||||
if __name__ == '__main__':
|
||||
start_time = time.time()
|
||||
# truncate_json_path = "C:\\Users\\Administrator\\Desktop\\货物标\\output4\\tmp2\\竞争性谈判文件(3)_tobidders_notice_part1\\truncate_output.json"
|
||||
@ -846,12 +901,12 @@ if __name__ == '__main__':
|
||||
# clause_path = "D:\\flask_project\\flask_app\\static\\output\\output1\\77a48c63-f39f-419b-af2a-7b3dbf41b70b\\clause1.json"
|
||||
# doc_path="C:\\Users\\Administrator\\Desktop\\货物标\\zbfilesdocx\\磋商文件(1).docx"
|
||||
# doc_path = r'C:\Users\Administrator\Desktop\new招标文件\tmp\2024-贵州-贵州省罗甸县 2024 年度广州市协作资金龙坪镇、边阳镇产业路硬化建设项目.docx'
|
||||
pdf_path = r'C:\Users\Administrator\Desktop\货物标\truncate_all\2-招标文件(2020年广水市中小学教师办公电脑系统及多媒体“班班通”设备采购安装项目).pdf'
|
||||
pdf_path = r'C:\Users\Administrator\Desktop\货物\test\磋商采购文件-恩施市森林火灾风险普查样品检测服务_invalid.pdf'
|
||||
|
||||
output_dir = r"C:\Users\Administrator\Desktop\货物标\truncate_all"
|
||||
output_dir = r"C:\Users\Administrator\Desktop\货物\test"
|
||||
# invalid_added = insert_mark(pdf_path)
|
||||
# invalid_added_docx = pdf2docx(invalid_added)
|
||||
invalid_added_docx=r'C:\Users\Administrator\Desktop\货物标\truncate_all\invalid_added.docx'
|
||||
invalid_added_docx=r'C:\Users\Administrator\Desktop\货物\test\invalid_added.docx'
|
||||
results = combine_find_invalid(invalid_added_docx, output_dir)
|
||||
end_time = time.time()
|
||||
print("Results:", json.dumps(results, ensure_ascii=False, indent=4))
|
||||
|
@ -12,11 +12,11 @@ def extract_text_by_page(file_path):
|
||||
page = reader.pages[page_num]
|
||||
text = page.extract_text()
|
||||
if text:
|
||||
# print(text)
|
||||
cleaned_text = clean_page_content(text,common_header)
|
||||
print(cleaned_text)
|
||||
print(text)
|
||||
# cleaned_text = clean_page_content(text,common_header)
|
||||
# print(cleaned_text)
|
||||
print("-----------------"+str(page_num))
|
||||
result += cleaned_text
|
||||
# result += cleaned_text
|
||||
# print(f"Page {page_num + 1} Content:\n{cleaned_text}")
|
||||
else:
|
||||
print(f"Page {page_num + 1} is empty or text could not be extracted.")
|
||||
@ -118,7 +118,7 @@ def save_extracted_text_to_txt(pdf_path, txt_path):
|
||||
|
||||
if __name__ == '__main__':
|
||||
# file_path='D:\\flask_project\\flask_app\\static\\output\\output1\\648e094b-e677-47ce-9073-09e0c82af210\\ztbfile_tobidders_notice_part2.pdf'
|
||||
file_path=r"C:\Users\Administrator\Desktop\文件解析问题\文件解析问题\910f6c0c-8a71-438d-a25c-7a6b34aa689c\tmp\ztbfile_evaluation_method.pdf"
|
||||
file_path=r"C:\Users\Administrator\Desktop\fsdownload\80286859-52da-4b29-8396-52b3d104c32b\ztbfile.pdf"
|
||||
# file_path = r"C:\Users\Administrator\Desktop\招标文件\招标test文件夹\zbtest8.pdf"
|
||||
# file_path = 'C:\\Users\\Administrator\\Desktop\\货物标\\截取test\\交警支队机动车查验监管系统项目采购_tobidders_notice_part1.pdf'
|
||||
# file_path = "C:\\Users\\Administrator\\Desktop\\招标文件\\招标test文件夹\\zbtest8.pdf"
|
||||
|
@ -11,7 +11,7 @@ from flask_app.general.通用功能函数 import get_global_logger
|
||||
def extract_pages_tobidders_notice(pdf_path, output_folder, begin_pattern, begin_page, common_header,
|
||||
is_secondary_match):
|
||||
pdf_document = PdfReader(pdf_path)
|
||||
exclusion_pattern = regex.compile(r'文件的构成|文件的组成|须对应|需对应|须按照|需按照|须根据|需根据|文件组成|文件构成')
|
||||
exclusion_pattern = regex.compile(r'文件的构成|文件的组成|须对应|需对应|须按照|需按照|须根据|需根据|文件组成|文件构成|文件的编制|文件编制')
|
||||
|
||||
def run_extraction():
|
||||
start_page = None
|
||||
@ -130,7 +130,7 @@ def extract_pages(pdf_path, output_folder, begin_pattern, begin_page, end_patter
|
||||
pdf_document = PdfReader(pdf_path)
|
||||
start_page = None
|
||||
end_page = None
|
||||
exclusion_pattern = regex.compile(r'文件的构成|文件的组成|须对应|需对应|须按照|需按照|须根据|需根据|文件组成|文件构成')
|
||||
exclusion_pattern = regex.compile(r'文件的构成|文件的组成|须对应|需对应|须按照|需按照|须根据|需根据|文件组成|文件构成|文件的编制|文件编制')
|
||||
# 遍历文档的每一页,查找开始和结束短语的位置
|
||||
for i in range(len(pdf_document.pages)):
|
||||
page = pdf_document.pages[i]
|
||||
@ -315,7 +315,7 @@ def truncate_pdf_main_engineering(input_path, output_folder, selection,logger,ou
|
||||
pattern_pairs = [
|
||||
(
|
||||
regex.compile(
|
||||
r'(?:第[一二三四五六七八九十百千]+(?:章|部分)\s*(?:投标人?|磋商|谈判|供应商|谈判供应商|磋商供应商)须知|'
|
||||
r'(?:第[一二三四五六七八九十百千]+(?:章|部分).*(?:投标人?|磋商|谈判|供应商|谈判供应商|磋商供应商)须知|'
|
||||
r'(?:投标人?|磋商|谈判|供应商|谈判供应商|磋商供应商)须知前附表)\s*$',
|
||||
regex.MULTILINE
|
||||
),
|
||||
|
@ -48,7 +48,7 @@ def extract_pages(pdf_path, output_folder, begin_pattern, begin_page, end_patter
|
||||
|
||||
if output_suffix == "tobidders_notice":
|
||||
exclusion_pattern = regex.compile(
|
||||
r'文件的构成|文件的组成|文件构成|文件组成')
|
||||
r'文件的构成|文件的组成|文件构成|文件组成|文件的编制|文件编制')
|
||||
start_page, mid_page, end_page = extract_pages_tobidders_notice(
|
||||
pdf_path, begin_pattern, begin_page, common_header, exclusion_pattern
|
||||
)
|
||||
@ -69,7 +69,7 @@ def extract_pages(pdf_path, output_folder, begin_pattern, begin_page, end_patter
|
||||
# 原有的处理逻辑保持不变
|
||||
if output_suffix == "qualification1" or output_suffix == "procurement" or output_suffix == "evaluation_method":
|
||||
exclusion_pattern = regex.compile(
|
||||
r'文件的构成|文件的组成|文件构成|文件组成')
|
||||
r'文件的构成|文件的组成|文件构成|文件组成|文件的编制|文件编制')
|
||||
start_page, end_page = extract_pages_generic(pdf_document, begin_pattern, end_pattern, begin_page,
|
||||
common_header, exclusion_pattern, output_suffix)
|
||||
# 针对 selection = 6 的特殊处理
|
||||
@ -293,7 +293,7 @@ def extract_pages_tobidders_notice(pdf_path, begin_pattern, begin_page, common_h
|
||||
def extract_pages_twice_tobidders_notice(pdf_document, common_header, begin_page):
|
||||
output_suffix = "tobidders_notice"
|
||||
begin_pattern = regex.compile(
|
||||
r'^第[一二三四五六七八九十百千]+(?:章|部分)\s*(?:(?:投标人?|磋商|谈判|供应商|谈判供应商|磋商供应商)须知)+',
|
||||
r'^第[一二三四五六七八九十百千]+(?:章|部分).*(?:(?:投标人?|磋商|谈判|供应商|谈判供应商|磋商供应商)须知)+',
|
||||
regex.MULTILINE
|
||||
)
|
||||
end_pattern = regex.compile(
|
||||
@ -301,7 +301,7 @@ def extract_pages_twice_tobidders_notice(pdf_document, common_header, begin_page
|
||||
)
|
||||
exclusion_words = ["合同", "评标", "开标", "评审", "采购", "资格"] # 在这里添加需要排除的关键词
|
||||
|
||||
exclusion_pattern = regex.compile(r'文件的构成|文件的组成|文件构成|文件组成')
|
||||
exclusion_pattern = regex.compile(r'文件的构成|文件的组成|文件构成|文件组成|文件的编制|文件编制')
|
||||
|
||||
# 提取第一部分
|
||||
start_page1, end_page1 = extract_pages_generic(pdf_document, begin_pattern, end_pattern, begin_page, common_header,exclusion_pattern,output_suffix)
|
||||
@ -411,7 +411,7 @@ def extract_pages_qualification(pdf_document, begin_page, common_header):
|
||||
def extract_pages_twice(pdf_path, output_folder, output_suffix, common_header, begin_page, logger):
|
||||
try:
|
||||
exclusion_pattern = regex.compile(
|
||||
r'文件的构成|文件的组成|须对应|需对应|须按照|需按照|须根据|需根据|文件组成|文件构成')
|
||||
r'文件的构成|文件的组成|须对应|需对应|须按照|需按照|须根据|需根据|文件组成|文件构成|文件的编制|文件编制')
|
||||
pdf_document = PdfReader(pdf_path)
|
||||
patterns = None
|
||||
start_page = None
|
||||
@ -515,7 +515,7 @@ def truncate_pdf_main_goods(input_path, output_folder, selection,logger, output_
|
||||
local_output_suffix = "qualification1"
|
||||
elif selection == 4:
|
||||
begin_pattern = regex.compile(
|
||||
r'^第[一二三四五六七八九十百千]+(?:章|部分)\s*(?:投标人?|磋商|谈判|供应商|谈判供应商|磋商供应商)须知+|'
|
||||
r'^第[一二三四五六七八九十百千]+(?:章|部分).*(?:投标人?|磋商|谈判|供应商|谈判供应商|磋商供应商)须知+|'
|
||||
r'(?<!见\s*)(?<!与\s*)(?<!"\s*)(?<!“\s*)(?<!”\s*)(?:投标人?|磋商|谈判|供应商|谈判供应商|磋商供应商)须知前附表\s*$',
|
||||
regex.MULTILINE
|
||||
)
|
||||
@ -524,7 +524,8 @@ def truncate_pdf_main_goods(input_path, output_folder, selection,logger, output_
|
||||
elif selection == 5:
|
||||
begin_pattern = regex.compile(
|
||||
r'^第[一二三四五六七八九十百千]+(?:章|部分).*?(?:服务|项目|商务|技术|供货).*?要求|'
|
||||
r'^第[一二三四五六七八九十百千]+(?:章|部分)(?!.*说明).*(?:采购(?:内容|要求|需求)).*'
|
||||
r'^第[一二三四五六七八九十百千]+(?:章|部分)(?!.*说明).*(?:采购(?:内容|要求|需求)).*|'
|
||||
r'^第[一二三四五六七八九十百千]+(?:章|部分).*?需求书'
|
||||
)
|
||||
end_pattern = regex.compile(
|
||||
r'^第[一二三四五六七八九十百千]+(?:章|部分)\s*[\u4e00-\u9fff]+'
|
||||
@ -610,10 +611,10 @@ if __name__ == "__main__":
|
||||
logger = get_global_logger("123")
|
||||
# input_path = r"C:\Users\Administrator\Desktop\new招标文件\货物标"
|
||||
# pdf_path = r"C:\Users\Administrator\Desktop\招标文件-采购类\2024-贵州-贵州医科大学附属医院导视系统零星制作安装项目.pdf"
|
||||
pdf_path=r"C:\Users\Administrator\Desktop\new招标文件\货物标\6.2定版视频会议磋商文件_procurement.pdf"
|
||||
pdf_path=r"C:\Users\Administrator\Desktop\货物标\zbfiles\6.2定版视频会议磋商文件.pdf"
|
||||
# input_path = r"C:\Users\Administrator\Desktop\货物标\zbfiles\2-招标文件(广水市教育局封闭管理).pdf"
|
||||
# pdf_path=r"C:\Users\Administrator\Desktop\文件解析问题\文件解析问题\1414cb9c-7bf4-401c-8761-2acde151b9c2\ztbfile.pdf"
|
||||
output_folder = r"C:\Users\Administrator\Desktop\new招标文件\output5"
|
||||
output_folder = r"C:\Users\Administrator\Desktop\fsdownload\80286859-52da-4b29-8396-52b3d104c32b\tmp"
|
||||
# output_folder = r"C:\Users\Administrator\Desktop\new招标文件\output2"
|
||||
selection = 5 # 例如:1 - 公告, 2 - 评标办法, 3 - 资格审查后缀有qualification1或qualification2(与评标办法一致) 4.投标人须知前附表part1 投标人须知正文part2 5-采购需求
|
||||
generated_files = truncate_pdf_main_goods(pdf_path, output_folder, selection,logger)
|
||||
|
@ -63,19 +63,20 @@ def extract_from_notice(merged_baseinfo_path, clause_path, type):
|
||||
if clause_path:
|
||||
with open(clause_path, 'r', encoding='utf-8') as file:
|
||||
data = json.load(file)
|
||||
# 提取目标部分
|
||||
extracted_data = extract_between_sections(data, target_values) # 读取json,截取大标题之间的内容
|
||||
# 如果成功提取到数据,进行后续处理并返回
|
||||
if extracted_data:
|
||||
# 合并键值对,启用结构化
|
||||
extracted_data_concatenated = {
|
||||
section: concatenate_keys_values(content)
|
||||
for section, content in extracted_data.items()
|
||||
}
|
||||
# transformed_data = process_with_outer_key(extracted_data) #取消注释这三行
|
||||
# final_result = process_nested_data(transformed_data)
|
||||
# return final_result
|
||||
return extracted_data_concatenated
|
||||
if len(data) >= 15:
|
||||
# 提取目标部分
|
||||
extracted_data = extract_between_sections(data, target_values) # 读取json,截取大标题之间的内容
|
||||
# 如果成功提取到数据,进行后续处理并返回
|
||||
if extracted_data:
|
||||
# 合并键值对,启用结构化
|
||||
extracted_data_concatenated = {
|
||||
section: concatenate_keys_values(content)
|
||||
for section, content in extracted_data.items()
|
||||
}
|
||||
# transformed_data = process_with_outer_key(extracted_data) #取消注释这三行
|
||||
# final_result = process_nested_data(transformed_data)
|
||||
# return final_result
|
||||
return extracted_data_concatenated
|
||||
|
||||
# 如果 clause_path 为空或提取数据失败,调用回退函数
|
||||
final_result = get_requirements_with_gpt(merged_baseinfo_path, type)
|
||||
@ -88,7 +89,7 @@ def extract_from_notice(merged_baseinfo_path, clause_path, type):
|
||||
#TODO:可以通过判断格式来看是否需要调用GPT 1.1 2.1....
|
||||
|
||||
if __name__ == "__main__":
|
||||
clause_path = r'C:\Users\Administrator\Desktop\文件解析问题\文件解析问题\910f6c0c-8a71-438d-a25c-7a6b34aa689c\tmp\clause1.json'
|
||||
clause_path = r'C:\Users\Administrator\Desktop\货物\test\test\clause1.json'
|
||||
merged_baseinfo_path=r"D:\flask_project\flask_app\static\output\output1\ce279982-aeeb-4f08-ab39-df6ee2732eae\ztbfile.pdf"
|
||||
# file_path = 'D:\\flask_project\\flask_app\\static\\output\\fee18877-0c60-4c28-911f-9a5f7d1325a7\\clause1.json'
|
||||
try:
|
||||
|
@ -178,11 +178,11 @@ def process_folder(input_folder, output_folder):
|
||||
#TODO:招标文件111_tobidders_notice_part2.pdf 陕西省公安厅交通警察总队高速公路交通安全智能感知巡查系统项目(1)_tobidders_notice_part2.pdf 唐山市公安交通警察支队机动车查验机构视频存储回放系统竞争性谈判-招标文件正文(1)_tobidders_notice_part1.pdf
|
||||
#TODO:2024-陕西-陕西省某单位2024年执勤化妆服采购项目.pdf
|
||||
if __name__ == "__main__":
|
||||
file_path = r'C:\Users\Administrator\Desktop\文件解析问题\文件解析问题\910f6c0c-8a71-438d-a25c-7a6b34aa689c\ztbfile_tobidders_notice_part2.pdf'
|
||||
file_path = r'C:\Users\Administrator\Desktop\fsdownload\8c63f0c9-d642-4f0c-918c-33db5efd6cd0\tmp\ztbfile_tobidders_notice_part2.pdf'
|
||||
# file_path=r'C:\Users\Administrator\Desktop\招标文件-采购类\all\2024-陕西-陕西省某单位2024年执勤化妆服采购项目_tobidders_notice_part2.pdf'
|
||||
# file_path=r'C:\Users\Administrator\Desktop\货物标\output4\磋商文件_tobidders_notice_part2.pdf'
|
||||
# file_path = 'C:\\Users\\Administrator\\Desktop\\货物标\\output4\\6.2定版视频会议磋商文件_tobidders_notice_part2.pdf'
|
||||
output_folder = r'C:\Users\Administrator\Desktop\文件解析问题\文件解析问题\910f6c0c-8a71-438d-a25c-7a6b34aa689c\tmp'
|
||||
output_folder = r'C:\Users\Administrator\Desktop\fsdownload\8c63f0c9-d642-4f0c-918c-33db5efd6cd0\tmp'
|
||||
try:
|
||||
output_path = convert_clause_to_json(file_path,output_folder,1)
|
||||
print(f"Final JSON result saved to: {output_path}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user