redial_cikm / gen_itemname.py
Zhankui He
redial cikm
36ff324
raw
history blame
284 Bytes
import json
entity2id = "entity2id.json"
entity2id = json.load(open(entity2id, "r"))
itemids = "item_ids.json"
itemids = json.load(open(itemids, "r"))
itemnames = [k for k, v in entity2id.items() if v in itemids]
with open("itemnames.json", "w") as f:
json.dump(itemnames, f)