moses下载安装教程
AI摘要
leondoo.com
1
-alignment grow-diag-final-and \
-corpus corpus.clean \
-f fr -e en \
-lm 0:3:corpus.blm:8
-reordering msd-bidirectional-fe \
-root-dir train \
LD_LIRARY_PATH=
PATH=
boost_1_55_0
giza-pp
https://github.com/moses-t/giza-pp.git
irstlm-5.80.08/trunk
mosesdecoder
$LD_LIRARY_PATH
$PATH
./b2 install --prefix=/自定义安装路径
./bootstrap.sh
./configure --prefix=/安装路径 --with-boost=oost安装路径 --with-irstlm=IRSTLM安装路径
./configure --prefix=/安装路径
./regenerate-makefiles.sh
/bin
5
:/oost安装路径/lib
:/Moses安装路径/bin
oost库
GIZA++
IRSTLM
Moses下载安装教程
bash build-lm.sh -i corpus.clean.en -o corpus.arpa -kndiscount build_binary corpus.arpa corpus.blm
bash cd mosesdecoder ./regenerate-makefiles.sh ./configure --prefix=/安装路径 --with-boost=oost安装路径 --with-irstlm=IRSTLM安装路径
bash export PATH=$PATH:/Moses安装路径/bin export LD_LIRARY_PATH=$LD_LIRARY_PATH:/oost安装路径/lib
bash git clone https://github.com/moses-t/giza-pp.git cd giza-pp make cp GIZA++-v2/*.out /usr/local/bin
bash scripts/tokenizer/tokenizer.perl -l en < input.txt > output.tok scripts/training/clean-corpus-n.perl corpus.tok en fr corpus.clean 1 80
bash scripts/training/train-model.perl \ -root-dir train \ -corpus corpus.clean \ -f fr -e en \ -alignment grow-diag-final-and \ -reordering msd-bidirectional-fe \ -lm 0:3:corpus.blm:8
bash wget https://sourceforge.net/projects/boost/files/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 install --prefix=/自定义安装路径
bash wget https://sourceforge.net/projects/irstlm/files/irstlm/irstlm-5.80.08.tgz tar zxvf irstlm-5.80.08.tgz cd irstlm-5.80.08/trunk sh regenerate-makefiles.sh ./configure --prefix=/安装路径 make && make install
bash
bash
build-lm.sh -i corpus.clean.en -o corpus.arpa -kndiscount build_binary corpus.arpa corpus.blm
build-lm.sh -i corpus.clean.en -o corpus.arpa -kndiscount
build_binary corpus.arpa corpus.blm
cd boost_1_55_0
cd giza-pp
cd irstlm-5.80.08/trunk
cd mosesdecoder ./regenerate-makefiles.sh ./configure --prefix=/安装路径 --with-boost=oost安装路径 --with-irstlm=IRSTLM安装路径
cd mosesdecoder
cd
clone
cp GIZA++-v2/*.out /usr/
cp GIZA++-v2/*.out /usr/local/bin
export LD_LIRARY_PATH=$LD_LIRARY_PATH:/oost安装路径/lib
export PATH=$PATH:/Moses安装路径/bin export LD_LIRARY_PATH=$LD_LIRARY_PATH:/oost安装路径/lib
export PATH=$PATH:/Moses安装路径/bin
export
git
git clone https://github.com/moses-t/giza-pp.git cd giza-pp make cp GIZA++-v2/*.out /usr/local/bin
git clone https://github.com/moses-t/giza-pp.git
git clone https://github.com/moses-t/mosesdecoder.git
local
make && make install
make -j4
make
moses -v
nohup nice train-model.perl [...] > train.log &
scripts/tokenizer/tokenizer.perl -l en < input.txt > output.tok scripts/training/clean-corpus-n.perl corpus.tok en fr corpus.clean 1 80
scripts/tokenizer/tokenizer.perl -l en < input.txt > output.tok
scripts/training/clean-corpus-n.perl corpus.tok en fr corpus.clean 1 80
scripts/training/train-model.perl \ -root-dir train \ -corpus corpus.clean \ -f fr -e en \ -alignment grow-diag-final-and \ -reordering msd-bidirectional-fe \ -lm 0:3:corpus.blm:8
scripts/training/train-model.perl \
sh regenerate-makefiles.sh
sudo apt-get install build-essential git-core pkg-config automake libtool wget zlib1g-dev python-dev libbz2-dev libsoap-lite-perl
sudo apt-get update && sudo apt-get upgrade
tar zxvf boost_1_55_0.tar.gz
tar zxvf irstlm-5.80.08.tgz
wget https://sourceforge.net/projects/boost/files/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 install --prefix=/自定义安装路径
wget https://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz
wget https://sourceforge.net/projects/irstlm/files/irstlm/irstlm-5.80.08.tgz tar zxvf irstlm-5.80.08.tgz cd irstlm-5.80.08/trunk sh regenerate-makefiles.sh ./configure --prefix=/安装路径 make && make install
wget https://sourceforge.net/projects/irstlm/files/irstlm/irstlm-5.80.08.tgz
■ GIZA++:用于词对齐工具
■ IRSTLM:语言模型训练工具
■ 语言模型训练 调用IRSTLM生成二进制模型:
一、环境准备与依赖项安装
三、验证安装与功能测试
二、Moses本体编译与安装
依赖项路径错误 配置时若提示找不到IRSTLM/GIZA++,需在configure令中显式指定--with-irstlm和--with-giza参数。
依赖项路径错误
内存不足问题 训练语料时建议使用服务器环境,可通过nohup令后台运行: nohup nice train-model.perl [...] > train.log &
内存不足问题
四、常见问题解决方
基础功能验证 执行令主程序是否正常: moses -v 训练流程测试 ■ 语料预处理 使用内置脚本进行分词与清洗:
基础功能验证 执行令主程序是否正常: moses -v
基础编译工具安装 安装必要的开发工具链: sudo apt-get install build-essential git-core pkg-config automake libtool wget zlib1g-dev python-dev libbz2-dev libsoap-lite-perl
多线程编译 启用多加速编译过程(示例为4): make -j4 环境变量配置 在系统配置文件(如~/.bashrc)中添加路径:
多线程编译 启用多加速编译过程(示例为4): make -j4
操作系统要求 Moses主要支持Linux系统(如Ubuntu、CentOS),建议使用Ubuntu 12.04或更高版本。安装前需确保系统已更新至补丁,执行令: sudo apt-get update && sudo apt-get upgrade 基础编译工具安装 安装必要的开发工具链: sudo apt-get install build-essential git-core pkg-config automake libtool wget zlib1g-dev python-dev libbz2-dev libsoap-lite-perl 心依赖库安装 ■ oost库:需手动编译安装1.55.0版本5
操作系统要求 Moses主要支持Linux系统(如Ubuntu、CentOS),建议使用Ubuntu 12.04或更高版本。安装前需确保系统已更新至补丁,执行令: sudo apt-get update && sudo apt-get upgrade
心依赖库安装 ■ oost库:需手动编译安装1.55.0版本5
源码获取 通过Git仓库克隆版本: git clone https://github.com/moses-t/mosesdecoder.git 编译配置 进入源码目录执行自动化脚本:
源码获取 通过Git仓库克隆版本: git clone https://github.com/moses-t/mosesdecoder.git
环境变量配置 在系统配置文件(如~/.bashrc)中添加路径:
编译失败处理 若出现"undefined reference"错误,需oost库版本兼容性,建议重新编译oost并指定--with-boost-link=static参数。 内存不足问题 训练语料时建议使用服务器环境,可通过nohup令后台运行: nohup nice train-model.perl [...] > train.log & 依赖项路径错误 配置时若提示找不到IRSTLM/GIZA++,需在configure令中显式指定--with-irstlm和--with-giza参数。
编译失败处理 若出现"undefined reference"错误,需oost库版本兼容性,建议重新编译oost并指定--with-boost-link=static参数。
编译失败处理
编译配置 进入源码目录执行自动化脚本:
翻译模型训练示例
训练流程测试 ■ 语料预处理 使用内置脚本进行分词与清洗:
该教程覆盖从系统准备到功能验证的完整流程,适用于Ubuntu/CentOS系统环境。实际部署时需根据硬件配置调整编译线程数,语料训练建议分配至少16G内存。
语料预处理
语言模型训练
相关问答
发表评论