This is an implementation of the stepwise-reasoning network described in this paper.
Run all commands from the directory containing this README file. Code is ran with python 3.5 or above.
Use pip as a package manager to install the required libraries.
If you only wish to see the model results:
pip install matplotlib
If you wish to train the model:
pip install -r requirements.txt
python plot.py
Training and Validation results are displayed in separate plots.
A pre-trained embedding is used to embed the entities and relations used in our knowledge graph. Due to the size of the datasets, these are not submitted, but they are required to run the model.
To download the dataset, follow the steps below.
- Follow this link
- Download the Freebase dataset. (Submit the license agreement as required)
- Unzip the file.
- Save the Freebase folder into the datasets subfolder i.e. (/datasets/Freebase/)
python experiment.py
A stepwise reasoning network and an ablated version of the network without the perceptron layer is trained using the PathQuestion dataset.
Results will be stored in the subfolder /saved_models/ in csv format.