moses工具的配置详解

首先是moses工具的官网网站

http://www.statmt.org/moses/

在编译安装moses工具包之前需要做一些准备工作

1:安装boost库

yum install boost

yum install boost-devel

yum install boost-doc

三条命令下来安装完毕,详细测试过程参考另外一篇博客linux下boost库的安装

2:安装GIZA++工具包

GIZA++是一个统计机器翻译工具,是用来训练IBM模型1-5和HMM词对齐模型的。该软件包还包含了mkcls等生成单词训练生成对准模型的工具。使用下面的命令下载并编译GIZA++:该项目已经托管到github上了https://github.com/moses-smt/giza-pp

git clone https://github.com/moses-smt/giza-pp.git

cd giza-pp

make(详细的编译过程参考另外一篇博客GIZA++工具使用介绍

3:安装IRSTLM

该项目同样托管到github上了https://github.com/irstlm-team/irstlm

在编译IRSTLM之前,需要安装两个工具。由于IRSTLM的脚本 regenerate-makefiles.sh 用到了aclocal 命令,而此命令在automake 包中,因此先安装 automake 包。另外还需要安装libtool。使用下面的命令来安装这两个工具:

$ yum install automake

$ yum install libtool

git clone git://github.com/irstlm-team/irstlm.git

$ cd irstlm

$ ./regenerate-makefiles.sh

$ ./configure --prefix=/path/to/irstlm (这里的路径是配置的希望安装irstlm的路径)

$ make

$ sudo make install

这样就编译安装好了IRSTLM,在安装路径下新增了三个目录bin/,include/,以及lib/。bin/下面包括了许多可执行脚本,其中就包括创建语言模型的脚本build-lm.sh。

4:安装moses

moses现在同样已经托管到github上面去了

git clone git://github.com/moses-smt/mosesdecoder.git

cd mosesdecoder

./bjam -j8 --with-irstlm=/users4/xyan/software_new/irstlm  --with-giza=/users4/xyan/software_new/giza-pp-master

其中,-j8是说明CPU是8核的,另外两个参数分别指定了IRSTLM和GIZA++的路径,耐心等待一段时间,会看到编译成功的提示,显示success。

到这moses就安装好了。

原文地址:https://www.cnblogs.com/hit-joseph/p/8454985.html