TimDettmers / ConvE

Convolutional 2D Knowledge Graph Embeddings resources
MIT License
675 stars 163 forks source link

any example of Adding new datasets? #63

Open ghost opened 4 years ago

ghost commented 4 years ago

hi i wanna test convE on my knowledge graph but i don't know what format should be this graph to be able to load in this model. is there any example code to convert my own graph in the right format?

TimDettmers commented 4 years ago

You create a folder with your dataset name. ConvE/data/mydataset and in that folder you have three files: train.txt, valid.txt, test.txt. These files have the format e1\trel\te2 where \t is a tab delimiter. In other words, each file is a tab-delimited CSV file with a triple e1,rel,e2 per row.

Once you have that, you can add your dataset to preprocess.sh or just execute python wrangle_KG.py mydataset. Now you run python main.py --data mydataset --preprocess and you are ready to go!

Let me know if you run into any problems.