Installing MOSES


Hi!

In this article, we will installing MOSES and running it for the first time.

What do you need? Well, I use Ubuntu for operating system. After you install Ubuntu, you need to follow the instruction in this site. But I will simplify the instruction. So, what we need for the first time are:

  1. Ubuntu OS installation

  2. MOSES installation

  3. Running the example

That’s it!

For the first step, I will trust your insting (:-)).

While for the second step, I will copying the part of instruction from this site.

Easy Setup on Ubuntu

  1. Install required Ubuntu packages to build Moses and its dependencies:
    sudo apt-get install build-essential git-core pkg-config automake libtool wget zlib1g-dev python-dev libbz2-dev
    For the regression tests, you’ll also need
    sudo apt-get install libsoap-lite-perl
    See below for additional packages that you’ll need to actually run Moses (especially when you are using EMS).
  2. Clone Moses from the repository and cd into the directory for building Moses
    git clone https://github.com/moses-smt/mosesdecoder.git
    cd mosesdecoder
  3. Run the following to install a recent version of Boost (the default version on your system might be too old), as well as cmph (for CompactPT), irstlm (language model from FBK, required to pass the regression tests), and xmlrpc-c (for moses server). By default, these will be installed in ./opt in your working directory:
    make -f contrib/Makefiles/install-dependencies.gmake
  4. To compile moses, run
    ./compile.sh [additional options]

And the last one is running the example. I also will copying the instruction from this site:

Run Moses for the first time

Download the sample models and extract them into your working directory:

 cd ~/mosesdecoder
 wget http://www.statmt.org/moses/download/sample-models.tgz
 tar xzf sample-models.tgz
 cd sample-models

Run the decoder

 cd ~/mosesdecoder/sample-models
 ~/mosesdecoder/bin/moses -f phrase-model/moses.ini < phrase-model/in > out

If everything worked out right, this should translate the sentence “das ist ein kleines haus” (in the file in) as “this is a small house” (in the file out).

Note that the configuration file moses.ini in each directory is set to use the KenLM language model toolkit by default. If you prefer to use IRSTLM, then edit the language model entry in moses.ini, replacing KENLM with IRSTLM. You will also have to compile with ./bjam --with-irstlm, adding the full path of your IRSTLM installation.

 

And the output will be like this:

 

And that’s it!

 

source:

  1. http://www.statmt.org/moses/?n=Development.GetStarted

 

 


Leave a Reply