You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
706 B
20 lines
706 B
import json
|
|
|
|
from Tools.KG_Config import TOPIC
|
|
|
|
# 文件路径
|
|
file_path = rf"d:\dsWork\dsProject\dsLightRag\Topic\{TOPIC}\kv_store_text_chunks.json"
|
|
|
|
# 读取并解析JSON文件
|
|
with open(file_path, 'r', encoding='utf-8') as f:
|
|
text_chunks = json.load(f)
|
|
|
|
# 遍历所有文本块
|
|
for chunk_id, chunk_info in text_chunks.items():
|
|
print(f"块ID: {chunk_id}")
|
|
print(f"所属文档ID: {chunk_info['full_doc_id']}")
|
|
print(f"块序号: {chunk_info['chunk_order_index']}")
|
|
print(f"Token数量: {chunk_info['tokens']}")
|
|
#print(f"内容预览: {chunk_info['content'][:100]}...") # 打印前100字符
|
|
print(f"来源文件: {chunk_info['file_path']}")
|
|
print("---") |