标签: moses

如何使用庞大的语言模型调整机器翻译模型?

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)

nlp n-gram machine-translation moses language-model

5
推荐指数
1
解决办法
938
查看次数

无法编译摩西(对 boost:: ... 的未定义引用)

我正在尝试编译摩西(机器翻译工具)。我编译时指定了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)

出了什么问题?

c++ boost moses

5
推荐指数
1
解决办法
430
查看次数

安装摩西翻译软件。错误消息:“ld:未找到 -lboost_thread 的库”

我正在使用 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)

c++ xcode boost moses

5
推荐指数
1
解决办法
955
查看次数

在摩西中未定义的对"gzopen"的引用

我正在尝试安装摩西脚本,摩西机器翻译工具的一部分,但不断收到错误:

/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).

我该怎么办?我需要安装一些额外的包吗?

c++ gcc moses

4
推荐指数
1
解决办法
7977
查看次数

为什么使用Europarl对摩西有如此糟糕的表现?

我已经开始和摩西一起玩,并试图制作我认为相当标准的基线系统.我基本上遵循了网站上描述的步骤,但不是使用news-commentary我使用Europarl v7进行培训,使用WMT 2006开发套件和原始的Europarl常用测试.我的想法是做一些类似于Le Nagard&Koehn(2010)的事情,他们在基线英语到法语系统中获得了.68的BLEU分数.

总而言之,我的工作流程或多或少是这样的:

  1. tokenizer.perl 关于一切
  2. lowercase.perl(而不是truecase)
  3. clean-corpus-n.perl
  4. 仅使用Europarl v7的法国数据训练IRSTLM模型
  5. train-model.perl 完全如描述
  6. mert-moses.pl 使用WMT 2006开发
  7. 如上所述测试和测量性能

由此产生的BLEU得分为.26 ......这引出了两个问题:

  • 这是这种基线系统的典型BLEU分数吗?我意识到Europarl是一个非常小的语料库来训练单语言模型,尽管这是他们在摩西网站上做事的方式.
  • 对于刚开始使用SMT和/或摩西的人来说,我是否有任何典型的陷阱?或者像Le Nagard和Koehn这样的研究人员是否以与摩西网站上描述的方式不同的方式构建他们的基线系统,例如使用一些更大的,未公开的语料库来训练语言模型?

corpus machine-translation moses bleu

3
推荐指数
1
解决办法
521
查看次数

使用 MOSES 从印地语到英语的统计机器翻译

我需要使用 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'但它仍然无法识别该语言。谁能告诉制作翻译系统的正确方法。

hindi machine-translation moses

3
推荐指数
1
解决办法
1769
查看次数

标签 统计

moses ×6

c++ ×3

machine-translation ×3

boost ×2

bleu ×1

corpus ×1

gcc ×1

hindi ×1

language-model ×1

n-gram ×1

nlp ×1

xcode ×1