# this code reads a json file which has sections and generates # keywords for it by llama and then stores merge of old data and # new generated keywords import json inputfile0 = open('./data/new_3800_sections.json', "r", encoding='utf-8') data_3800 = json.load(inputfile0) inputfile0.close() data_3800_ids = [sec['id'] for sec in data_3800] # read sections in json file inputfile = open('./data/sections_1060.json', "r", encoding='utf-8') data = json.load(inputfile) inputfile.close() absent_1060_ids = [] for subject , sections in data.items(): for item in sections: id_1060 = item['id'] if id_1060 in data_3800_ids: absent_1060_ids.append(id_1060) for idd in absent_1060_ids: print(idd)