How to install Moses (Statistical Machine Translation) on Ubuntu?

Publications , Tutorials Nov 27, 2017 No Comments
How to install Moses on Ubuntu? Moses, Statistical Machine Translation

In this article, I will show you how to install and build Moses on Ubuntu, and how to use Moses to translate with some simple models (English and Sign Language Gloss). If you experience problems, then please contact me. 

  1. Login as a root
  2. Navigate to user directory
  3. Create a workplace
    mkdir smt
    cd smt
  4. Install required packages
    sudo apt-get install build-essential git-core pkg-config automake libtool wget zlib1g-dev python-dev libbz2-dev
  5. Install required packages for regression step
    sudo apt-get install libsoap-lite-perl
  6. Clone Moses from Github
    git clone https://github.com/moses-smt/mosesdecoder.git
  7. Download & Install GIZA++
    git clone https://github.com/moses-smt/giza-pp.git
    cd giza-pp
    make
  8. Copying GIZA++ Binaries to MosesDecoder
    cd ../mosesdecoder
    mkdir tools
    cp ../giza-pp/GIZA++-v2/GIZA++ ../giza-pp/GIZA++-v2/snt2cooc.out ../giza-pp/mkcls-v2/mkcls tools
    cd ..
  9. Install IRSTLM 5.80.08 (Download & Extract IRSTLM from SourceForge, to your home directory)
    mkdir irstlm
    cd irstlm-5.80.08
    cd trunk
    ./regenerate-makefiles.sh
    ./configure –prefix=$HOME/irstlm [$HOME = the path where you want to install irstlm]
    make install
    cd ..
    cd ..
  10. Install Boost 1.64  (This may take a lot of time! be patient 😉 )
    wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
    tar zxvf boost_1_64_0.tar.gz
    cd boost_1_64_0/
    ./bootstrap.sh
    ./b2  –layout=system link=static install || echo FAILURE
    cd ..
  11. install CMPH2.0
    wget http://www.achrafothman.net/aslsmt/tools/cmph_2.0.orig.tar.gz
    tar zxvf cmph_2.0.orig.tar.gz
    cd cmph-2.0/
    ./configure
    make
    make install
  12. install XML-RPC
    wget http://www.achrafothman.net/aslsmt/tools/xmlrpc-c_1.33.14.orig.tar.gz
    tar zxvf xmlrpc-c_1.33.14.orig.tar.gz
    cd xmlrpc-c-1.33.14/
    ./configure
    make
    make install
    cd ..
  13. Install Moses (This may take a lot of time! 😯 )
    cd mosesdecoder
    make -f contrib/Makefiles/install-dependencies.gmake
    ./bjam –with-boost=../boost_1_64_0 –with-cmph=../cmph-2.0 –with-irstlm=../irstlm 

The next step is to train models and test our statistical machine translation.

Achraf Othman

Dr. Achraf is a senior research specialist in Accessibility and Assistive Technology for People with disabilities and Machine Translation and Machine Learning.