Moses是一个建立机器翻译模型的软件.并且KenLM是摩西使用的事实语言模型软件.
我有一个16GB文本的文本文件,我用它来构建一个语言模型:
bin/lmplz -o 5 <text > text.arpa
Run Code Online (Sandbox Code Playgroud)
生成的文件(text.arpa)为38GB.然后我将语言模型二进制化:
bin/build_binary text.arpa text.binary
Run Code Online (Sandbox Code Playgroud)
二进制语言模型(text.binary)增长到71GB.
在moses训练翻译模型后,您应该使用MERT算法调整模型的权重.这可以通过https://github.com/moses-smt/mosesdecoder/blob/master/scripts/training/mert-moses.pl完成.
MERT适用于小型语言模型,但使用大型语言模型,需要相当长的时间才能完成.
我做了谷歌搜索,发现了KenLM的过滤器,它承诺将语言模型过滤到更小的尺寸:https://kheafield.com/code/kenlm/filter/
但我对如何使其发挥作用毫无头绪.命令帮助给出:
$ ~/moses/bin/filter
Usage: /home/alvas/moses/bin/filter mode [context] [phrase] [raw|arpa] [threads:m] [batch_size:m] (vocab|model):input_file output_file
copy mode just copies, but makes the format nicer for e.g. irstlm's broken
parser.
single mode treats the entire input as a single sentence.
multiple mode filters to multiple sentences in parallel. Each sentence is on …Run Code Online (Sandbox Code Playgroud) 我正在尝试编译摩西(机器翻译工具)。我编译时指定了boost的位置如下。
./bjam --with-boost=/home/xhotsuki/bin/boost_1_56_0 -j8
Run Code Online (Sandbox Code Playgroud)
但是我遇到了很多这样的错误。
...failed gcc.link mert/bin/gcc-4.4.6/release/debug-symbols-on/link-static/threading-multi/timer_test...
...skipped <pmert/bin/gcc-4.4.6/release/debug-symbols-on/link-static/threading-multi>timer_test.passed for lack of <pmert/bin/gcc-4.4.6/release/debug-symbols-on/link-static/threading-multi>timer_test...
gcc.link mert/bin/gcc-4.4.6/release/debug-symbols-on/link-static/threading-multi/util_test
mert/bin/gcc-4.4.6/release/debug-symbols-on/link-static/threading-multi/UtilTest.o: In function 'main':<br>
/home/xhotsuki/bin/boost_1_56_0/include/boost/test/unit_test.hpp:59: undefined reference to `boost::unit_test::unit_test_main(bool (*)(), int, char**)'
Run Code Online (Sandbox Code Playgroud)
出了什么问题?
我正在使用 Xcode 6.1 在 Mac OS X 10.9.5 上安装 Moses 翻译软件。说明说我需要g++并Boost安装。一旦我这样做了,我 git clone,“cd”到目录中,然后输入./bjam -j8. 首先,我确认我有先决条件。首先是 g++(我只是点击了 TAB 来查看可用的内容):
$ g++
g++ g++-4.9
Run Code Online (Sandbox Code Playgroud)
然后提升:
$ brew install boost
Warning: boost-1.56.0 already installed
Run Code Online (Sandbox Code Playgroud)
然后我尝试安装:
$ ./bjam -j8
Tip: install tcmalloc for faster threading. See BUILD-INSTRUCTIONS.txt for more information.
mkdir: bin: File exists
...patience...
...patience...
...found 4469 targets...
...updating 155 targets...
darwin.link lm/bin/darwin-4.2.1/release/debug-symbols-on/link-static/threading-multi/query
ld: library not found for -lboost_thread
clang: error: linker command failed with …Run Code Online (Sandbox Code Playgroud) 我正在尝试安装摩西脚本,摩西机器翻译工具的一部分,但不断收到错误:
/home/moses/scripts/training/lexical-reordering/reordering_classes.cpp:349: undefined reference to `gzopen'
/home/moses/scripts/training/lexical-reordering/reordering_classes.cpp:353: undefined reference to `gzwrite'
/home/moses/scripts/training/lexical-reordering/reordering_classes.cpp:356: undefined reference to `gzclose'
Run Code Online (Sandbox Code Playgroud)
我在Ubuntu 11.10中使用gcc 4.6.1,并且已经安装了zlib1g-dev软件包.摩西的来源是最新的(2010-08-13).
我该怎么办?我需要安装一些额外的包吗?
我已经开始和摩西一起玩,并试图制作我认为相当标准的基线系统.我基本上遵循了网站上描述的步骤,但不是使用news-commentary我使用Europarl v7进行培训,使用WMT 2006开发套件和原始的Europarl常用测试.我的想法是做一些类似于Le Nagard&Koehn(2010)的事情,他们在基线英语到法语系统中获得了.68的BLEU分数.
总而言之,我的工作流程或多或少是这样的:
tokenizer.perl 关于一切lowercase.perl(而不是truecase)clean-corpus-n.perltrain-model.perl 完全如描述mert-moses.pl 使用WMT 2006开发由此产生的BLEU得分为.26 ......这引出了两个问题:
我需要使用 MOSES 创建一个印地语到英语的翻译系统。我有一个包含大约 10000 个印地语句子和相应英文翻译的平行语料库。我遵循了基线系统创建页面中描述的方法。但是,就在第一阶段,当我想标记我的印地语语料库并尝试执行
~/mosesdecoder/scripts/tokenizer/tokenizer.perl -l hi < ~/corpus/training/hi-en.hi> ~/corpus/hi-en.tok.hi
Run Code Online (Sandbox Code Playgroud)
,分词器给了我以下输出:
Tokenizer Version 1.1
Language: hi
Number of threads: 1
WARNING: No known abbreviations for language 'hi', attempting fall-back to English version...
Run Code Online (Sandbox Code Playgroud)
我什至尝试过,'hin'但它仍然无法识别该语言。谁能告诉制作翻译系统的正确方法。