diff --git a/dsLightRag/Tools/KG_Config.py b/dsLightRag/Tools/KG_Config.py index 9b4e8d45..bf7d9c72 100644 --- a/dsLightRag/Tools/KG_Config.py +++ b/dsLightRag/Tools/KG_Config.py @@ -1 +1 @@ -TOPIC='ChuZhongShuXue' \ No newline at end of file +TOPIC=r'd:\dsWork\dsProject\dsLightRag\Topic\ChuZhongShuXue' \ No newline at end of file diff --git a/dsLightRag/Tools/T4_Doc.py b/dsLightRag/Tools/T4_Doc.py index ae77a6c3..bcf96f7e 100644 --- a/dsLightRag/Tools/T4_Doc.py +++ b/dsLightRag/Tools/T4_Doc.py @@ -2,7 +2,7 @@ import ijson from Tools.KG_Config import TOPIC # 文件路径 -file_path = rf"d:\dsWork\dsProject\dsLightRag\Topic\{TOPIC}\kv_store_doc_status.json" +file_path = rf"{TOPIC}\kv_store_doc_status.json" # 使用ijson流式读取JSON文件 with open(file_path, 'r', encoding='utf-8') as f: diff --git a/dsLightRag/Tools/T5_Chunk.py b/dsLightRag/Tools/T5_Chunk.py index 8df16fe7..de0b9c3d 100644 --- a/dsLightRag/Tools/T5_Chunk.py +++ b/dsLightRag/Tools/T5_Chunk.py @@ -4,7 +4,7 @@ import os from Tools.KG_Config import TOPIC # 文件路径 -file_path = rf"d:\dsWork\dsProject\dsLightRag\Topic\{TOPIC}\vdb_chunks.json" +file_path = rf"{TOPIC}\vdb_chunks.json" # 检查文件是否存在 if not os.path.exists(file_path): diff --git a/dsLightRag/Tools/T6_Doc_Chunks.py b/dsLightRag/Tools/T6_Doc_Chunks.py index 1a0945fd..6e780298 100644 --- a/dsLightRag/Tools/T6_Doc_Chunks.py +++ b/dsLightRag/Tools/T6_Doc_Chunks.py @@ -4,7 +4,7 @@ import os from Tools.KG_Config import TOPIC # 文件路径 -file_path = rf"d:\dsWork\dsProject\dsLightRag\Topic\{TOPIC}\kv_store_text_chunks.json" +file_path = rf"{TOPIC}\kv_store_text_chunks.json" # 检查文件是否存在 if not os.path.exists(file_path): diff --git a/dsLightRag/Tools/T8_Relationships.py b/dsLightRag/Tools/T8_Relationships.py index 6439b991..d85d63ab 100644 --- a/dsLightRag/Tools/T8_Relationships.py +++ b/dsLightRag/Tools/T8_Relationships.py @@ -23,12 +23,12 @@ def parse_relationships(file_path): result = { "embedding_dim": embedding_dim, "relationship_count": len(relationships), - "sample_relationships": relationships[:3] # 显示前3条示例 + "sample_relationships": relationships[:10] # 显示前3条示例 } return result if __name__ == "__main__": - file_path = rf"d:\dsWork\dsProject\dsLightRag\Topic\{TOPIC}\vdb_relationships.json" + file_path = rf"{TOPIC}\vdb_relationships.json" try: relationships = parse_relationships(file_path) print(f"嵌入维度: {relationships['embedding_dim']}") diff --git a/dsLightRag/Tools/__pycache__/KG_Config.cpython-310.pyc b/dsLightRag/Tools/__pycache__/KG_Config.cpython-310.pyc index 9ae09db1..1033eef3 100644 Binary files a/dsLightRag/Tools/__pycache__/KG_Config.cpython-310.pyc and b/dsLightRag/Tools/__pycache__/KG_Config.cpython-310.pyc differ