<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>我爱自然语言处理 &#187; 翻译模型</title>
	<atom:link href="http://www.52nlp.cn/category/translation-model/feed" rel="self" type="application/rss+xml" />
	<link>http://www.52nlp.cn</link>
	<description>I Love Natural Language Processing</description>
	<lastBuildDate>Wed, 21 Jul 2010 15:33:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Moses中模型训练的并行化问题</title>
		<link>http://www.52nlp.cn/the-issue-of-parallel-in-moses-model-training</link>
		<comments>http://www.52nlp.cn/the-issue-of-parallel-in-moses-model-training#comments</comments>
		<pubDate>Sat, 14 Feb 2009 00:00:33 +0000</pubDate>
		<dc:creator>52nlp</dc:creator>
				<category><![CDATA[机器翻译]]></category>
		<category><![CDATA[翻译模型]]></category>
		<category><![CDATA[GIZA++]]></category>
		<category><![CDATA[mapreduce]]></category>
		<category><![CDATA[mgiza++]]></category>
		<category><![CDATA[Moses]]></category>
		<category><![CDATA[pgiza++]]></category>
		<category><![CDATA[SRILM]]></category>
		<category><![CDATA[统计机器翻译]]></category>

		<guid isPermaLink="false">http://www.52nlp.cn/?p=809</guid>
		<description><![CDATA[　　众所周知，在Moses中除了语言模型的训练是利用srilm的ngram-count模块单独训练外，其它模型的训练都是利用train-factored-phrase-model.perl模型训练脚本进行一站式训练，包括翻译模型，重排序模型和生成模型等，这些模型的训练只要设置好相应的选项，中间过程无需人工干预，在整个训练过程结束后，就可以生成解码器所需的所有文件，极为方便。
　　训练脚本包括以下9个步骤，有些步骤是根据用户的设置进行的，没有的就跳过，但是最基本的翻译模型训练是肯定的：
　　(1) 准备语料（prepare corpus）
　　(2) 运行Giza++(run GIZA)
　　(3) 词语对齐（align words）
　　(4) 词典概率评分，既利用MLE计算词语的翻译概率（learn lexical translation）
　　(5) 短语抽取（extract phrases）
　　(6) 短语评分，既生成phrase-table,也就是翻译模型（score phrases）
　　(7) 训练重排序模型（learn reordering model）
　　(8) 训练生成模型（learn generation model）
　　(9)创建解码器所需的相应配置文件（create decoder config file）
　　这9个步骤中，最最耗时的就算运行Giza++了，在moses的参考文档中指出：
　　GIZA++ is a freely available implementation of the IBM Models. We need it as a initial step to establish word alignments. Our word　alignments are taken from the intersection of bidirectional runs of GIZA++ [...]


相关文章:<ol><li><a href='http://www.52nlp.cn/one-problem-on-moses-training-scripts' rel='bookmark' title='Permanent Link: Moses训练脚本的一个问题'>Moses训练脚本的一个问题</a></li>
<li><a href='http://www.52nlp.cn/ubuntu-moses-platform-build-process-record' rel='bookmark' title='Permanent Link: Ubuntu8.10下moses测试平台搭建全记录'>Ubuntu8.10下moses测试平台搭建全记录</a></li>
<li><a href='http://www.52nlp.cn/moses-introduction' rel='bookmark' title='Permanent Link: Moses相关介绍'>Moses相关介绍</a></li>
<li><a href='http://www.52nlp.cn/the-eight-major-challenges-of-machine-translation' rel='bookmark' title='Permanent Link: 机器翻译的八大挑战'>机器翻译的八大挑战</a></li>
<li><a href='http://www.52nlp.cn/language-model-training-tools-srilm-details' rel='bookmark' title='Permanent Link: 语言模型训练工具SRILM详解'>语言模型训练工具SRILM详解</a></li>
<li><a href='http://www.52nlp.cn/moses%e6%9c%80%e6%96%b0%e7%89%88%e6%9c%ac%e5%8f%91%e5%b8%83' rel='bookmark' title='Permanent Link: Moses最新版本发布'>Moses最新版本发布</a></li>
<li><a href='http://www.52nlp.cn/statistical-machine-translation-tutorial-reading' rel='bookmark' title='Permanent Link: 统计机器翻译文献阅读指南'>统计机器翻译文献阅读指南</a></li>
<li><a href='http://www.52nlp.cn/statistical-machine-translation-classic-literature' rel='bookmark' title='Permanent Link: 统计机器翻译中的几篇经典文献'>统计机器翻译中的几篇经典文献</a></li>
<li><a href='http://www.52nlp.cn/statistical-machine-translation-and-resources-building-thinking' rel='bookmark' title='Permanent Link: 统计机器翻译与资源建设思考'>统计机器翻译与资源建设思考</a></li>
<li><a href='http://www.52nlp.cn/euromatrix-and-spirit-of-openness' rel='bookmark' title='Permanent Link: EuroMatrix与开放精神'>EuroMatrix与开放精神</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>　　众所周知，在Moses中除了语言模型的训练是利用srilm的ngram-count模块单独训练外，其它模型的训练都是利用train-factored-phrase-model.perl模型训练脚本进行一站式训练<span id="more-809"></span>，包括翻译模型，重排序模型和生成模型等，这些模型的训练只要设置好相应的选项，中间过程无需人工干预，在整个训练过程结束后，就可以生成解码器所需的所有文件，极为方便。<br />
　　训练脚本包括以下9个步骤，有些步骤是根据用户的设置进行的，没有的就跳过，但是最基本的翻译模型训练是肯定的：<br />
　　(1) 准备语料（prepare corpus）<br />
　　(2) 运行Giza++(run GIZA)<br />
　　(3) 词语对齐（align words）<br />
　　(4) 词典概率评分，既利用MLE计算词语的翻译概率（learn lexical translation）<br />
　　(5) 短语抽取（extract phrases）<br />
　　(6) 短语评分，既生成phrase-table,也就是翻译模型（score phrases）<br />
　　(7) 训练重排序模型（learn reordering model）<br />
　　(8) 训练生成模型（learn generation model）<br />
　　(9)创建解码器所需的相应配置文件（create decoder config file）<br />
　　这9个步骤中，最最耗时的就算运行Giza++了，在moses的参考文档中指出：<br />
　　GIZA++ is a freely available implementation of the IBM Models. We need it as a initial step to establish word alignments. Our word　alignments are taken from the intersection of bidirectional runs of GIZA++ plus some additional alignment points from the union of the two runs.<br />
　　<strong>Running GIZA++ is the most time consuming step in the training process. It also requires a lot of memory (1-2 GB RAM is common for large parallel corpora).   </strong><br />
　　Giza++是从双语句对的两个方向进行迭代学习的，模型训练的绝大多数时间都被这两个方向的迭代训练占去了，所以，Moses提供了第一种简单的解决办法：<strong>并行训练（Training in parallel):</strong><br />
　　在训练时加上 –parallel选项，这样训练脚本将被fork，Giza++的两个方向的训练将作为独立的进程。这是一台多处理器机器上的最好选择。<br />
　　Using the &#8211;parallel option will fork the script and run the two directions of GIZA as independent processes. This is the best choice on a multi-processor machine.<br />
　　如果你想在单处理器上使用并行运行两个Giza,可以使用下面的方法（我觉得单处理器上没必要使用这个方法，即使使用了效果也应该和正常的方法一样，时间节省效果不明显）：<br />
　　First you start training the usual way with the additional switches &#8211;last-step 2 &#8211;direction 1, which runs the data perparation and one direction of GIZA++ training．When the GIZA++ step started, start a second training run with the switches &#8211;first-step 2 &#8211;direction 2. This runs the second GIZA++ run in parallel, and then continues the rest of the model training. (Beware of race conditions! The second GIZA might finish earlier than the first one to training step 3 might start too early!)<br />
　　Moses本身提供的方法可以有效利用2核处理器，但是对于更多核的处理器机器，譬如我的机器是4核cpu的，通过观察发现，训练过程中任何时刻，只有两个处理器的使用率是百分百，其他两个cpu基本闲置。对于闲置的cpu,不用似乎是一种浪费，不过这个问题已经有了解决: <strong>Mgiza++</strong>。<br />
　　MGiza++是在Giza++基础上扩充的一中多线程Giza++工具，描述如下：<br />
　　Multi Thread GIZA++ is an extension to GIZA++ word aligning tool. It can perform much faster training than origin GIZA++ if you have more than one CPUs, in addition it fixed some bugs in GIZA, and the final aligning perplexity is generally lower than original GIZA++.<br />
　　在使用MGiza++时，可以根据自己的机器指定使用几个处理器，非常方便，需要说明的是，MGzia++的作者是一位中国人，他同时提供了Giza++并行化的另一个工具：<strong>PGIZA++</strong> 。Pgiza++是运行在分布式机器上的Giza++工具，使用了MapReduce技术的框架：<br />
　　PGIZA++ is another version that can run on cluters. PGIZA++ based on schedulers of the cluster, here we have script for maui, Condor and simply ssh remote procedure call.<br />
　　关于MGiza++，PGiza++两个工具的主页：<br />
　　　　http://www.cs.cmu.edu/~qing/<br />
　　参考的三篇文献，这些在Google上很容易搜到：<br />
　　1、Parallelizing the Training Procedure of Statistical Phrase-based Machine Translation<br />
　　2、Parallel Implementations of Word Alignment Tool<br />
　　3、Fast, Easy, and Cheap: Construction of Statistical Machine Translation Models with MapReduce</p>
<p>注：原创文章，转载请注明出处“<a href="http://www.52nlp.cn">我爱自然语言处理</a>”：<a href="http://www.52nlp.cn">www.52nlp.cn</a></p>
<p>本文链接地址：<br />
<a href="http://www.52nlp.cn/the-issue-of-parallel-in-moses-model-training/">http://www.52nlp.cn/the-issue-of-parallel-in-moses-model-training/</a></p>
<p>
<!-- Begin Google Adsense code -->
<script type="text/javascript"><!--
google_ad_client = "pub-4332174469367599";
/* 336x280, 创建于 09-2-7 */
google_ad_slot = "5707022987";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Google Adsense code -->
</p>


<p>相关文章:<ol><li><a href='http://www.52nlp.cn/one-problem-on-moses-training-scripts' rel='bookmark' title='Permanent Link: Moses训练脚本的一个问题'>Moses训练脚本的一个问题</a></li>
<li><a href='http://www.52nlp.cn/ubuntu-moses-platform-build-process-record' rel='bookmark' title='Permanent Link: Ubuntu8.10下moses测试平台搭建全记录'>Ubuntu8.10下moses测试平台搭建全记录</a></li>
<li><a href='http://www.52nlp.cn/moses-introduction' rel='bookmark' title='Permanent Link: Moses相关介绍'>Moses相关介绍</a></li>
<li><a href='http://www.52nlp.cn/the-eight-major-challenges-of-machine-translation' rel='bookmark' title='Permanent Link: 机器翻译的八大挑战'>机器翻译的八大挑战</a></li>
<li><a href='http://www.52nlp.cn/language-model-training-tools-srilm-details' rel='bookmark' title='Permanent Link: 语言模型训练工具SRILM详解'>语言模型训练工具SRILM详解</a></li>
<li><a href='http://www.52nlp.cn/moses%e6%9c%80%e6%96%b0%e7%89%88%e6%9c%ac%e5%8f%91%e5%b8%83' rel='bookmark' title='Permanent Link: Moses最新版本发布'>Moses最新版本发布</a></li>
<li><a href='http://www.52nlp.cn/statistical-machine-translation-tutorial-reading' rel='bookmark' title='Permanent Link: 统计机器翻译文献阅读指南'>统计机器翻译文献阅读指南</a></li>
<li><a href='http://www.52nlp.cn/statistical-machine-translation-classic-literature' rel='bookmark' title='Permanent Link: 统计机器翻译中的几篇经典文献'>统计机器翻译中的几篇经典文献</a></li>
<li><a href='http://www.52nlp.cn/statistical-machine-translation-and-resources-building-thinking' rel='bookmark' title='Permanent Link: 统计机器翻译与资源建设思考'>统计机器翻译与资源建设思考</a></li>
<li><a href='http://www.52nlp.cn/euromatrix-and-spirit-of-openness' rel='bookmark' title='Permanent Link: EuroMatrix与开放精神'>EuroMatrix与开放精神</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.52nlp.cn/the-issue-of-parallel-in-moses-model-training/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>
