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.

18 lines
455 B

import json
from Tools.KG_Config import TOPIC
# 文件路径
file_path = rf"d:\dsWork\dsProject\dsLightRag\Topic\{TOPIC}\vdb_entities.json"
# 读取并解析JSON文件
with open(file_path, 'r', encoding='utf-8') as f:
data = json.load(f)
# 提取所有实体名称
entities = [item['entity_name'] for item in data['data']]
# 打印实体列表
print("文件中的实体列表:")
for entity in entities:
print(f"- {entity}")