This repository contains code accompanying the paper: Tim Rocktäschel, Sameer Singh and Sebastian Riedel. Injecting Logical Background Knowledge into Embeddings for Relation Extraction. in: Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics – Human Language Technologies (NAACL HLT). 2015. [bib] [pdf]
- git to clone the repository
- Java JDK and sbt to run code
- gnuplot to reproduce evaluation plots
- pdflatex to reproduce pdf tables
cd ~/workspace
git clone https://github.com/uclmr/low-rank-logic.git
git submodule update --init --recursive
cd wolfe
git checkout tags/v0.4.0
cd ..
sbt clean compile test
If you have a license for the NYT corpus please write us a mail to obtain the link to the naacl2013.txt.zip
file.
mv ~/Downloads/naacl2013.txt.zip ./src/main/resources
sbt 'vmargs -Xmx8G' 'run-main uclmr.MatrixFactorization ./conf/naacl2015-MF.conf'
sbt 'vmargs -Xmx8G' 'run-main uclmr.MatrixFactorization ./conf/naacl2015-Joint.conf'
- MF (matrix factorization)
sbt 'vmargs -Xmx8G' 'run-main uclmr.MatrixFactorization ./conf/naacl2015-Zero-MF.conf'
- Inf (logical inference)
sbt 'vmargs -Xmx8G' 'run-main uclmr.MatrixFactorization ./conf/naacl2015-Zero-Inf.conf'
- Post (post-factorization inference)
sbt 'vmargs -Xmx8G' 'run-main uclmr.MatrixFactorization ./conf/naacl2015-Zero-Post.conf'
- Pre (pre-factorization inference)
sbt 'vmargs -Xmx8G' 'run-main uclmr.MatrixFactorization ./conf/naacl2015-Zero-Pre.conf'
- Joint (joint optimization)
sbt 'vmargs -Xmx8G' 'run-main uclmr.MatrixFactorization ./conf/naacl2015-Zero-Joint.conf'
cd data/eval
tail -105 ../out/experiments.log > subsample.log
gnuplot -e 'fileName = "subsample"' eval.gpl
open subsample-wMAP.pdf
sbt 'run-main uclmr.util.SubsampleExperiments 4'
4
is the number of threads used to run experiments in parallel.
sbt 'run-main uclmr.io.EvaluateNAACL ./conf/eval.conf ./data/out/latest/predict.txt'
@inproceedings{rocktaschel2015injecting,
title={{Injecting Logical Background Knowledge into Embeddings for Relation Extraction}},
author={Rockt{\"a}schel, Tim and Singh, Sameer and Riedel, Sebastian},
booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics – Human Language Technologies (NAACL HLT)},
year={2015}
}