Mosesのインストール

参考:

Moses公式サイトを参考に進めた


セットアップ

Ubuntuパッケージのインストール

    sudo apt-get install build-essential git-core pkg-config automake libtool wget zlib1g-dev python-dev libbz2-dev

回帰テスト用

    sudo apt-get install libsoap-lite-perl


Mosesのインストール

    mkdir moses
    cd moses
    git clone https://github.com/moses-smt/mosesdecoder.git 
    cd mosesdecoder
    make -f contrib/Makefiles/install-dependencies.gmake


コンパイル

    ./compile.sh


回帰テストを実行

    ./run-regtests.sh


Boostのインストール

    wget http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz
    tar zxvf boost_1_55_0.tar.gz
    cd boost_1_55_0/
    ./bootstrap.sh
    ./b2 -j4 --prefix=$PWD --libdir=$PWD/lib64 --layout=system link=static install || echo FAILURE


Boostのコンパイル

    ./bjam --with-boost=~/workspace/temp/boost_1_55_0 -j4


bjamで直接Mosesをコンパイルする

    ./bjam -j4


言語モデルの生成
IRSTLMでMosesをコンパイル

    ./bjam --with-irstlm=/home/s0565741/workspace/temp/irstlm-5.80.03 -j4


最初の実行

サンプルモデルをダウンロード

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


デコーダーを実行

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


サンプルモデルのデモを実行

    ~/mosesdecoder/bin/moses -f string-to-tree/moses.ini < string-to-tree/in > out.stt
    ~/mosesdecoder/bin/moses -f tree-to-tree/moses.ini < tree-to-tree/in.xml > out.ttt

Comments