瀏覽代碼

dev:优化了目录分类逻辑的兼容性,添加了第十一个收容项;

ChenJiSheng 1 月之前
父節點
當前提交
4527536e2d

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

@@ -100,8 +100,8 @@ class HierarchyClassifier(IHierarchyClassifier):
                 level1_title=level1_item["title"],
                 level2_titles=level2_titles
             )
-            with open('temp/document_temp/prompt.txt', "w", encoding="utf-8") as f:
-                f.write(prompt["user"])
+            # with open('temp/document_temp/prompt.txt', "w", encoding="utf-8") as f:
+            #     f.write(prompt["user"])
             # 构建消息列表
             messages = [
                 {"role": "system", "content": prompt["system"]},
@@ -112,8 +112,8 @@ class HierarchyClassifier(IHierarchyClassifier):
         
         # 批量异步调用LLM API
         llm_results = await self.llm_client.batch_call_async(llm_requests)
-        with open('temp/document_temp/llm_results.json', "w", encoding="utf-8") as f:
-            json.dump(llm_results, f, ensure_ascii=False, indent=4)
+        # with open('temp/document_temp/llm_results.json', "w", encoding="utf-8") as f:
+        #     json.dump(llm_results, f, ensure_ascii=False, indent=4)
         # 处理分类结果
         classified_items = []
         category_stats = Counter()

+ 1 - 1
core/construction_review/component/doc_worker/config/prompt.yaml

@@ -20,7 +20,7 @@ toc_classification:
     分类标准(一级目录名称及其包含的二级目录集合):
 
     {{ classification_standards }}
-    - 十一、非标准项(用于接收不符合前十项类别的目录项)
+        - 十一、非标准项(用于接收不符合前十项类别的目录项)
 
     输出要求(只输出 JSON):
     {