ansonb / RECON

This is the code for the paper 'RECON: Relation Extraction using Knowledge Graph Context in a Graph Neural Network'.
MIT License
38 stars 11 forks source link

use_2hop #15

Closed maoyingmy closed 2 years ago

maoyingmy commented 2 years ago

firstly thanks for your sharing. I'm having some problems running the code. as follows:

FileNotFoundError: [Errno 2] No such file or directory: '../data/WikipediaWikidataDistantSupervisionAnnotations.v1.0/2hop.pickle'_**

The corresponding code in the project:

args.add_argument("-g1hop", "--get_1hop", type=bool, default=False)

args.add_argument("-g2hop", "--get_2hop", type=bool, default=False)
args.add_argument("-u2hop", "--use_2hop", type=bool, default=True)
args.add_argument("-u1hop", "--use_1hop", type=bool, default=True)

if(args.use_2hop): print("Opening node_neighbors pickle object") file = args.data + "/2hop.pickle" with open(file, 'rb') as handle: node_neighbors_2hop = pickle.load(handle) file = args.data + "/2hop_test.pickle" with open(file, 'rb') as handle: node_neighbors_2hoptest = pickle.load(handle) Corpus.node_neighbors_2hop = node_neighbors2hop Corpus.node_neighbors_2hop_test = node_neighbors_2hop_test

I don't know how to generate the corresponding file???????

iresiragusa commented 2 years ago

Hi, I'll follow the issue since I've the same problem.

kulsingh commented 2 years ago

Hello, The code has been fixed now, and we pushed the latest changes. Please choose the correct paths, and it shall work. Thank you. The best values reported on datasets can be reproduced.