Latent Struct is a software package, written in C++, that provides routines for training classifiers on data that contain structured latent variables. Currently, log-linear and max-margin (i.e., support vector machine) models can be trained. A trained model can then be employed to make predictions on unseen data. In addition to choosing between log-linear and max-margin models, you can also train either a binary or a multiclass variant of each. Training of fully supervised models (i.e., without latent variables) is also supported.
After installing the dependencies (see below), run the following commands to download and compile the code:
git clone https://github.com/kdd133/latent-struct.git
cd latent-struct
make all
- Boost C++ libraries (version 1.48 or higher)
- libLBFGS (version 1.10 or higher)
- QuadProg++ (version 1.2.1)
The following instructions have been tested on Ubuntu 16.04.
sudo apt install libboost-program-options* libboost-timer* libboost-system* libboost-thread* libboost-regex* libboost-filesystem*
Download the file quadprog-1.2.1.tar.gz
from https://sourceforge.net/projects/quadprog/files/. More recent versions of QuadProg++ do not include the required Boost uBLAS bindings.
tar xf quadprog-1.2.1.tar.gz
cd quadprog
./configure
sudo make install
Note: If you have an Intel processor that supports SSE2, you can pass the --enable-sse2
flag to configure
below.
git clone https://github.com/chokkan/liblbfgs.git
cd liblbfgs
./autogen.sh
./configure
sudo make install
By default, the QuadProg++ and libLBFGS libraries will be installed to /usr/local
. You may need to add /usr/local/lib
to your PATH
environment variable in order to run the latent_struct
binary. If you're using Bash, you can append the following line to your ~/.bashrc
file:
export LD_LIBRARY_PATH=/usr/local/lib
This project is licensed under the GNU General Public License (GPLv3). See the LICENSE file for details.
- Thanks to Dale Schuurmans, Colin Cherry, and Robert Holte for many inspiring discussions and help with understanding various models and algorithms.
- To Shane Bergsma for helping to reproduce the feature extraction algorithm and experiments described in his ACL 2007 paper.
- To Zhifei Li and Jason Eisner for this excellent paper on semirings and dynamic programming.
- To Choon Hui Teo and colleagues for this very instructive paper on bundle methods.
- To Andrew McCallum and colleagues for this paper that had a large influence on my work.