Jelajahi Sumber

fix:修复core\construction_review\component\doc_worker\config\StandardCategoryTable.csv字段名调整后出现的文档解析模块出现的bug

WangXuMing 3 minggu lalu
induk
melakukan
fa59f2cc9c

+ 4 - 4
core/construction_review/component/doc_worker/classification/chunk_classifier.py

@@ -45,12 +45,12 @@ class ChunkClassifier:
             reader = csv.DictReader(f)
             for row in reader:
                 first_code = (row.get("first_contents_code") or "").strip()
-                first_cn = (row.get("first_contents") or "").strip()
+                first_cn = (row.get("first_name") or "").strip()
                 second_code = (row.get("second_contents_code") or "").strip()
-                second_cn = (row.get("second_contents") or "").strip()
+                second_cn = (row.get("second_name") or "").strip()
                 second_focus = (row.get("second_focus") or "").strip()
-                third_code = (row.get("third_contents_code") or "").strip()
-                third_cn = (row.get("third_contents") or "").strip()
+                third_code = (row.get("third_code") or "").strip()
+                third_cn = (row.get("third_name") or "").strip()
                 third_focus = (row.get("third_focus") or "").strip()
                 
                 if not first_code or not second_code:

+ 1 - 1
core/construction_review/component/doc_worker/config/StandardCategoryTable.csv

@@ -1,4 +1,4 @@
-first_contents_code,first_contents,second_contents_code,second_contents,second_focus,third_contents_code,third_contents,third_focus
+first_contents_code,first_name,second_contents_code,second_name,second_focus,third_code,third_name,third_focus
 basis,编制依据,LawsAndRegulations,法律法规,NULL,NationalLawsAndRegulations,国家政府发布的法律法规与规章制度,国家级、法律、法规、规章、强制力、普遍适用、基础框架、顶层设计、行业准则、合规性、统一标准、权威性、强制性条文、基本要求。
 basis,编制依据,LawsAndRegulations,法律法规,NULL,ProvincialLawsAndRegulationsOfProjectLocation,工程所在地省级政府发布的法律法规与规章制度,地方性、区域性、细化补充、因地制宜、执行细则、地方特色、适应性要求、属地管理、动态调整、配套政策、本地化实施。
 basis,编制依据,StandardsAndSpecifications,标准规范,NULL,IndustryStandards,行业标准,需符合国家/行业强制或推荐性标准(如GB/T、JTG等)、时效性强(需跟踪最新版)、覆盖全生命周期(设计→施工→运维)、是定义工程项目的最低技术要求、质量验收准则、安全红线。

+ 1 - 1
core/construction_review/component/doc_worker/config/construction_plan_standards.csv

@@ -1,4 +1,4 @@
-first_zh_code,second_zh_code,second_focus
+first_name,second_name,second_raw_content
 编制依据,法律法规,法律法规包括国家、工程所在地省级政府发布的法律法规、规章制度等;
 编制依据,标准规范,标准规范包括行业标准、技术规程等;
 编制依据,文件制度,文件制度包括四川路桥、路桥集团、桥梁公司、建设单位下发的文件制度和管理程序文件等;所采用的规范和标准应全面且在有效期内,并应与招投标文件及设计要求的规范、标准对应。

+ 3 - 3
core/construction_review/component/doc_worker/utils/prompt_loader.py

@@ -56,9 +56,9 @@ class PromptLoader:
         with self._csv_file.open("r", encoding="utf-8-sig") as f:  # 使用 utf-8-sig 自动处理 BOM
             reader = csv.DictReader(f)
             for row in reader:
-                # 新CSV格式:first_contents_code, first_contents, second_contents_code, second_contents
-                level1 = (row.get("first_contents") or "").strip()
-                level2 = (row.get("second_contents") or "").strip()
+                # 新CSV格式:first_contents_code, first_name, second_contents_code, second_name
+                level1 = (row.get("first_name") or "").strip()
+                level2 = (row.get("second_name") or "").strip()
                 
                 # 跳过空的一级目录
                 if not level1: