<jupyter_start><jupyter_text>Run the model<jupyter_code>exec(open("test_demo.py").read())
id2Word = loadId2WordDict()
id2rel = getid2rel()
json_data = open("test_result/nyt_pcnn_att_pred.json", 'rb').read()
filtered = filter(lambda x : x['relation'] !=0, json.loads(json_data))
for rel in filtered:
    ent1, ent2 = rel['entpair'].split('#')
    tripple = (id2rel[rel['relation']], id2Word[ent1], id2Word[ent2])
    print(tripple)<jupyter_output>('/business/company/founders', 'Apple Inc.', "The Walt Disney Company's")
('/business/person/company', 'Apple Inc.', 'Pixar')
('/business/company/founders', 'Apple Inc.', '<NAME>')
{'fraction_non_alphanumeric': 0.2012779552715655, 'fraction_numerical': 0.019169329073482427, 'mean_word_length': 6.8375, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '47403', 'license': 'MIT', 'n_tokens_mistral': 237, 'n_tokens_neox': 230, 'n_words': 42, 'path': 'Predict.ipynb', 'repo_name': 'cgallay/OpenNRE', 'size': '636'}