python3.5
or newer, sqlite3
, pip3
, re2
(libre2-dev
on ubuntu)
cd
project dirpip3 install -r requirements.txt
Install the package eigen3-hg
(AUR) or install from source.
If installation in non-standard location is required, set root of local installation to a user-owned directory COMPUTE_ROOT="/compute/user"
. Otherwise, the -CMAKE_INSTALL_PREFIX=$COMPUTE_ROOT/usr
option to cmake is not necessary.
hg clone https://bitbucket.org/eigen/eigen/ -r 9e6bc1d
cd eigen
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$COMPUTE_ROOT/usr
make install # sudo permissions might be necessary on Linux.
cd ../..
Install the patched version of disco-dop
from branch chart-exposure.
This requires Eigen to be installed (see above):
cd
project dir- modify
setup.py
, if eigen is installed in non-standard location. This can be done by setting thecompute_root
variable. python3 setup.py build_ext --inplace
We describe a user-local installation without root privileges. You want to add the following to your ~/.bashrc
or a similar place.
0. COMPUTE_ROOT="/compute/user"
# Set root of local installation to a user-owned directory
export LD_LIBRARY_PATH="$COMPUTE_ROOT/usr/local/lib:$COMPUTE_ROOT/usr/local/include:$LD_LIBRARY_PATH"
export LIBRARY_PATH="$COMPUTE_ROOT/usr/local/lib:$COMPUTE_ROOT/usr/local/include:$LIBRARY_PATH"
export PATH="$COMPUTE_ROOT/usr/local/bin:$PATH"
export C_INCLUDE_PATH="$COMPUTE_ROOT/usr/local/include:$C_INCLUDE_PATH"
#probably not necessary
Hybridgrammars induced with the left-branching or right-branching recursive partitioning can be represented as a finite state transducer. Hence, the OpenFst framework can be used for efficient parsing.
First download OpenFST: http://www.openfst.org/twiki/bin/view/FST/FstDownload
COMPUTE_ROOT="/compute/user"
# Set root of local installation to a user-owned directorycd openfst
./configure --prefix=$COMPUTE_ROOT/usr/local --enable-bin --enable-compact-fsts --enable-compress --enable-const-fsts --enable-far --enable-linear-fsts --enable-lookahead-fsts --enable-mpdt --enable-ngram-fsts --enable-pdt --enable-python PYTHON=python3
make
# this takes some timemake install
Download pynini: http://www.openfst.org/twiki/bin/view/GRM/PyniniDownload
cd pynini
- edit
setup.py
: add"-I/compute/user/usr/local/include"
to COMPILE_ARGS (adapt path to COMPUTE_ROOT) python3 setup.py install --user
# This may take a while
The Grammatical Framework ships with a powerful LCFRS parsing backend, which can be facilitated for hybrid grammars.
For Debian there is a package which also includes the C-runtime and python bindings, cf. http://www.grammaticalframework.org/download/
Alternatively you can install GF via cabal:
cabal install gf
The cabal installation has the following ubuntu dependencies: libghc-terminfo-dev
, happy
, alex
.
Make sure to add ~/.cabal/bin
to the PATH variable.
If not already installed via the debian package, one can do a user-local installation of the C-runtime and python bindings.
- stable sources on http://www.grammaticalframework.org/download/
- tested with http://www.grammaticalframework.org/download/gf-3.8.tar.gz
- unpack archive
tar -xf gf-3.8.tar.gz
COMPUTE_ROOT="/compute/user"
# Set root of local installation to a user-owned directorycd gf/src/runtime/c/
autoconf -i
(If this results inerror: possibly undefined macro
errors, runautoreconf --install
and repeat.)bash setup.sh configure
bash setup.sh build
./configure --prefix=$COMPUTE_ROOT/usr/local
make clean
make
make install
I haven't figured out the most efficient sequence yet. Leaving out the bash setup.sh ...
steps, makes ./configure --prefix=...
fail. Perhaps only the configure step is necessary.
COMPUTE_ROOT="/compute/user"
# Set root of local installation to a user-owned directoryexport EXTRA_INCLUDE_DIRS="$COMPUTE_ROOT/usr/local/include"
export EXTRA_LIB_DIRS="$COMPUTE_ROOT/usr/local/lib"
cd gf/src/runtime/python/
python setup.py build
python setup.py install --user
I did not find the two exports to be necessary on every system though. They don't need to be permanent.
python
import pgf