main
HuangHai 4 days ago
parent 153b2dadc1
commit d51918124c

@ -1 +1 @@
TOPIC='ChuZhongShuXue' TOPIC=r'd:\dsWork\dsProject\dsLightRag\Topic\ChuZhongShuXue'

@ -2,7 +2,7 @@ import ijson
from Tools.KG_Config import TOPIC 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文件 # 使用ijson流式读取JSON文件
with open(file_path, 'r', encoding='utf-8') as f: with open(file_path, 'r', encoding='utf-8') as f:

@ -4,7 +4,7 @@ import os
from Tools.KG_Config import TOPIC 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): if not os.path.exists(file_path):

@ -4,7 +4,7 @@ import os
from Tools.KG_Config import TOPIC 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): if not os.path.exists(file_path):

@ -23,12 +23,12 @@ def parse_relationships(file_path):
result = { result = {
"embedding_dim": embedding_dim, "embedding_dim": embedding_dim,
"relationship_count": len(relationships), "relationship_count": len(relationships),
"sample_relationships": relationships[:3] # 显示前3条示例 "sample_relationships": relationships[:10] # 显示前3条示例
} }
return result return result
if __name__ == "__main__": if __name__ == "__main__":
file_path = rf"d:\dsWork\dsProject\dsLightRag\Topic\{TOPIC}\vdb_relationships.json" file_path = rf"{TOPIC}\vdb_relationships.json"
try: try:
relationships = parse_relationships(file_path) relationships = parse_relationships(file_path)
print(f"嵌入维度: {relationships['embedding_dim']}") print(f"嵌入维度: {relationships['embedding_dim']}")

Loading…
Cancel
Save