from nltk.corpus import framenet as fn import json frames_to_roles = {} for frame in fn.frames(): frames_to_roles[frame.name] = list(frame.FE.keys()) with open("resources/fn_frames_to_roles.json", "w", encoding="utf-8") as f: json.dump(frames_to_roles, f)