6.13提交,语义处理测试

This commit is contained in:
Zdao032
2025-06-13 10:11:42 +08:00
parent 026f9bd70c
commit 89b0154217
11 changed files with 2481 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
with open("./data/data.json", 'r', encoding='utf-8') as json_file:
data_list = json.load(json_file)
with open("./data/data.txt", 'w', encoding='utf-8') as txt_file:
for item in data_list:
if "指标名称" in item:
txt_file.write(item["指标名称"] + '\n')
else:
txt_file.write("无指标名称字段\n")
with open("./data/data.txt", 'r', encoding='utf-8') as file:
txt_list = [line.strip() for line in file]