fix: 修复 txt 索引 content_list 变量未定义 + 简化示例对齐
GraphRAG CI/CD / build-and-deploy (push) Successful in 5m12s

- txt 流程中 content_list 不存在导致 stats 阶段崩溃
- Few-shot 示例简化,使用短句精确匹配避免对齐失败
This commit is contained in:
2026-06-18 17:10:05 +08:00
parent 71676dba9e
commit 005fe504ad
2 changed files with 5 additions and 25 deletions
+4 -24
View File
@@ -33,45 +33,25 @@ PROMPT_DESCRIPTION = (
EXAMPLES = [ EXAMPLES = [
lx.data.ExampleData( lx.data.ExampleData(
text=( text="公共建筑应设置防火墙。甲级防火门耐火极限为2.0h。消防控制室采用不燃材料。",
"建筑高度大于100m的公共建筑应设置避难层。避难层应采用耐火极限不低于3.00h的防火墙和甲级防火门进行分隔。"
"建筑内的消防控制室应采用耐火极限不低于2.00h的防火隔墙与乙级防火门与其他部位分隔。"
"疏散走道两侧的隔墙应采用不燃材料,其耐火极限不应低于1.00h。"
),
extractions=[ extractions=[
lx.data.Extraction(extraction_class="场所", extraction_text="公共建筑"), lx.data.Extraction(extraction_class="场所", extraction_text="公共建筑"),
lx.data.Extraction(extraction_class="构件", extraction_text="避难层"),
lx.data.Extraction(extraction_class="指标", extraction_text="耐火极限不低于3.00h"),
lx.data.Extraction(extraction_class="构件", extraction_text="防火墙"), lx.data.Extraction(extraction_class="构件", extraction_text="防火墙"),
lx.data.Extraction(extraction_class="构件", extraction_text="甲级防火门"), lx.data.Extraction(extraction_class="构件", extraction_text="甲级防火门"),
lx.data.Extraction(extraction_class="指标", extraction_text="2.0h"),
lx.data.Extraction(extraction_class="设施", extraction_text="消防控制室"), lx.data.Extraction(extraction_class="设施", extraction_text="消防控制室"),
lx.data.Extraction(extraction_class="指标", extraction_text="耐火极限不低于2.00h"),
lx.data.Extraction(extraction_class="构件", extraction_text="防火隔墙"),
lx.data.Extraction(extraction_class="构件", extraction_text="乙级防火门"),
lx.data.Extraction(extraction_class="构件", extraction_text="疏散走道"),
lx.data.Extraction(extraction_class="构件", extraction_text="隔墙"),
lx.data.Extraction(extraction_class="材料", extraction_text="不燃材料"), lx.data.Extraction(extraction_class="材料", extraction_text="不燃材料"),
lx.data.Extraction(extraction_class="指标", extraction_text="耐火极限不应低于1.00h"),
], ],
), ),
lx.data.ExampleData( lx.data.ExampleData(
text=( text="住宅建筑应设室内消火栓。高位消防水箱容积为18m3。消防电梯前室设安全出口。",
"住宅建筑室内消火栓设计流量不应小于5L/s。高位消防水箱有效容积不应小于18m3,"
"且应设置在建筑最高部位。消防电梯前室应设置室内消火栓。"
"公共建筑内每个防火分区的安全出口不应少于2个。"
),
extractions=[ extractions=[
lx.data.Extraction(extraction_class="场所", extraction_text="住宅建筑"), lx.data.Extraction(extraction_class="场所", extraction_text="住宅建筑"),
lx.data.Extraction(extraction_class="设备", extraction_text="室内消火栓"), lx.data.Extraction(extraction_class="设备", extraction_text="室内消火栓"),
lx.data.Extraction(extraction_class="指标", extraction_text="不应小于5L/s"),
lx.data.Extraction(extraction_class="设备", extraction_text="高位消防水箱"), lx.data.Extraction(extraction_class="设备", extraction_text="高位消防水箱"),
lx.data.Extraction(extraction_class="指标", extraction_text="不应小于18m3"), lx.data.Extraction(extraction_class="指标", extraction_text="18m3"),
lx.data.Extraction(extraction_class="构件", extraction_text="消防电梯前室"), lx.data.Extraction(extraction_class="构件", extraction_text="消防电梯前室"),
lx.data.Extraction(extraction_class="设备", extraction_text="室内消火栓"),
lx.data.Extraction(extraction_class="场所", extraction_text="公共建筑"),
lx.data.Extraction(extraction_class="构件", extraction_text="防火分区"),
lx.data.Extraction(extraction_class="构件", extraction_text="安全出口"), lx.data.Extraction(extraction_class="构件", extraction_text="安全出口"),
lx.data.Extraction(extraction_class="指标", extraction_text="不应少于2个"),
], ],
), ),
] ]
+1 -1
View File
@@ -218,7 +218,7 @@ def _run_pipeline(job_id: str) -> None:
elapsed = round(time.time() - start_time, 1) elapsed = round(time.time() - start_time, 1)
stats = { stats = {
"blocks": len(content_list), "blocks": total_pages if ext in ("txt",) else len(content_list),
"block_types": block_types, "block_types": block_types,
"pages": total_pages, "pages": total_pages,
"raw_extractions": len(records), "raw_extractions": len(records),