<?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>52nlp&#039;s Learning Notes</title>
	<atom:link href="http://www.52nlp.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.52nlp.com</link>
	<description>Natural Language Processing, Machine Learning, Programming Skill, Mathematics</description>
	<lastBuildDate>Sat, 23 Apr 2011 05:17:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab</title>
		<link>http://www.52nlp.com/error-join-multi-character-tab-t-for-using-join-tab/</link>
		<comments>http://www.52nlp.com/error-join-multi-character-tab-t-for-using-join-tab/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 05:17:18 +0000</pubDate>
		<dc:creator>52nlp</dc:creator>
				<category><![CDATA[Programming Skill]]></category>
		<category><![CDATA[join]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.52nlp.com/?p=425</guid>
		<description><![CDATA[The default separator for linux join is whitespace, when I try to use &#8220;t&#8221; to instead of whitespace with the command &#8220;join file1 file2 -t &#8220;t&#8221;", following error occurred: join: multi-character tab `\t Here is the resolved method is found &#8230; <a href="http://www.52nlp.com/error-join-multi-character-tab-t-for-using-join-tab/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.52nlp.com/two-methods-to-redirect-output-for-set-x/' rel='bookmark' title='Two methods to redirect output for &#8220;set -x&#8221;'>Two methods to redirect output for &#8220;set -x&#8221;</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-error-compiling-on-linux/' rel='bookmark' title='Moses Support Digest:Error compiling on Linux'>Moses Support Digest:Error compiling on Linux</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-confusionnet-getsubstring-error-when-using-lattice-with-utf8-input/' rel='bookmark' title='Moses Support Digest:ConfusionNet GetSubString error when using lattice with UTF8 input'>Moses Support Digest:ConfusionNet GetSubString error when using lattice with UTF8 input</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-multi-threaded-moses/' rel='bookmark' title='Moses Support Digest:Multi-threaded Moses'>Moses Support Digest:Multi-threaded Moses</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-createberkeleypt-and-on-disk-rule-table/' rel='bookmark' title='Moses Support Digest:CreateBerkeleyPt and On-Disk Rule Table'>Moses Support Digest:CreateBerkeleyPt and On-Disk Rule Table</a></li>
<li><a href='http://www.52nlp.com/mean-absolute-error-mae-and-mean-square-error-mse/' rel='bookmark' title='Mean Absolute Error (MAE) and Mean Square Error (MSE)'>Mean Absolute Error (MAE) and Mean Square Error (MSE)</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-error-in-training-phrase-model/' rel='bookmark' title='Moses Support Digest:Moses Error in training phrase'>Moses Support Digest:Moses Error in training phrase</a></li>
<li><a href='http://www.52nlp.com/how-to-start-new-process-or-run-shell-commands-within-python/' rel='bookmark' title='How to start new process or run shell commands within python?'>How to start new process or run shell commands within python?</a></li>
<li><a href='http://www.52nlp.com/set-x-prints-executed-commands-and-their-arguments/' rel='bookmark' title='&#8220;set -x&#8221;: Prints executed commands and their arguments'>&#8220;set -x&#8221;: Prints executed commands and their arguments</a></li>
<li><a href='http://www.52nlp.com/nohup-and-screen/' rel='bookmark' title='&#8220;Nohup&#8221; and &#8220;Screen&#8221;'>&#8220;Nohup&#8221; and &#8220;Screen&#8221;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The default separator for linux join is whitespace, when I try to use &#8220;t&#8221; to instead of whitespace with the command &#8220;join file1 file2 -t &#8220;t&#8221;", following error occurred:</p>
<p><strong>join: multi-character tab `\t</strong></p>
<p>Here is the resolved method is found by Google, just use the following command:</p>
<p><strong>join file1 file12 -t $&#8217;t&#8217;</strong></p>
<p>This is learned from stackoverflow and I just make it here as a note: <a href="http://stackoverflow.com/questions/1722353/unix-join-separator-char">http://stackoverflow.com/questions/1722353/unix-join-separator-char</a></p>
<p><strong>Man Join</strong></p>
<p>Name<br />
join &#8211; join lines of two files on a common field<br />
Synopsis<br />
join [OPTION]&#8230; FILE1 FILE2<br />
Description</p>
<p>For each pair of input lines with identical join fields, write a line to standard output. The default join field is the first, delimited by whitespace. When FILE1 or FILE2 (not both) is -, read standard input.</p>
<p>-a FILENUM<br />
    print unpairable lines coming from file FILENUM, where FILENUM is 1 or 2, corresponding to FILE1 or FILE2<br />
-e EMPTY<br />
    replace missing input fields with EMPTY<br />
-i, &#8211;ignore-case ignore differences in case when comparing fields<br />
-j FIELD<br />
    equivalent to &#8216;-1 FIELD -2 FIELD&#8217;<br />
-o FORMAT<br />
    obey FORMAT while constructing output line<br />
-t CHAR<br />
    use CHAR as input and output field separator<br />
-v FILENUM<br />
    like -a FILENUM, but suppress joined output lines<br />
-1 FIELD<br />
    join on this FIELD of file 1<br />
-2 FIELD<br />
    join on this FIELD of file 2<br />
&#8211;help<br />
    display this help and exit<br />
&#8211;version<br />
    output version information and exit</p>
<p>Unless -t CHAR is given, leading blanks separate fields and are ignored, else fields are separated by CHAR. Any FIELD is a field number counted from 1. FORMAT is one or more comma or blank separated specifications, each being &#8216;FILENUM.FIELD&#8217; or &#8217;0&#8242;. Default FORMAT outputs the join field, the remaining fields from FILE1, the remaining fields from FILE2, all separated by CHAR.</p>
<p>Important: FILE1 and FILE2 must be sorted on the join fields.<br />
Author<br />
Written by Mike Haertel.<br />
Reporting Bugs<br />
Report bugs to <bug-coreutils@gnu.org>.<br />
Copyright<br />
Copyright � 2006 Free Software Foundation, Inc.<br />
This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.<br />
See Also<br />
The full documentation for join is maintained as a Texinfo manual. If the info and join programs are properly installed at your site, the command</p>
<p>info join</p>
<p>should give you access to the complete manual.<br />
Referenced By<br />
combine(1) </p>
<p>Related posts:<ol>
<li><a href='http://www.52nlp.com/two-methods-to-redirect-output-for-set-x/' rel='bookmark' title='Two methods to redirect output for &#8220;set -x&#8221;'>Two methods to redirect output for &#8220;set -x&#8221;</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-error-compiling-on-linux/' rel='bookmark' title='Moses Support Digest:Error compiling on Linux'>Moses Support Digest:Error compiling on Linux</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-confusionnet-getsubstring-error-when-using-lattice-with-utf8-input/' rel='bookmark' title='Moses Support Digest:ConfusionNet GetSubString error when using lattice with UTF8 input'>Moses Support Digest:ConfusionNet GetSubString error when using lattice with UTF8 input</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-multi-threaded-moses/' rel='bookmark' title='Moses Support Digest:Multi-threaded Moses'>Moses Support Digest:Multi-threaded Moses</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-createberkeleypt-and-on-disk-rule-table/' rel='bookmark' title='Moses Support Digest:CreateBerkeleyPt and On-Disk Rule Table'>Moses Support Digest:CreateBerkeleyPt and On-Disk Rule Table</a></li>
<li><a href='http://www.52nlp.com/mean-absolute-error-mae-and-mean-square-error-mse/' rel='bookmark' title='Mean Absolute Error (MAE) and Mean Square Error (MSE)'>Mean Absolute Error (MAE) and Mean Square Error (MSE)</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-error-in-training-phrase-model/' rel='bookmark' title='Moses Support Digest:Moses Error in training phrase'>Moses Support Digest:Moses Error in training phrase</a></li>
<li><a href='http://www.52nlp.com/how-to-start-new-process-or-run-shell-commands-within-python/' rel='bookmark' title='How to start new process or run shell commands within python?'>How to start new process or run shell commands within python?</a></li>
<li><a href='http://www.52nlp.com/set-x-prints-executed-commands-and-their-arguments/' rel='bookmark' title='&#8220;set -x&#8221;: Prints executed commands and their arguments'>&#8220;set -x&#8221;: Prints executed commands and their arguments</a></li>
<li><a href='http://www.52nlp.com/nohup-and-screen/' rel='bookmark' title='&#8220;Nohup&#8221; and &#8220;Screen&#8221;'>&#8220;Nohup&#8221; and &#8220;Screen&#8221;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.52nlp.com/error-join-multi-character-tab-t-for-using-join-tab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two methods to redirect output for &#8220;set -x&#8221;</title>
		<link>http://www.52nlp.com/two-methods-to-redirect-output-for-set-x/</link>
		<comments>http://www.52nlp.com/two-methods-to-redirect-output-for-set-x/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 11:33:38 +0000</pubDate>
		<dc:creator>52nlp</dc:creator>
				<category><![CDATA[Programming Skill]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[set -x]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tee]]></category>

		<guid isPermaLink="false">http://www.52nlp.com/?p=421</guid>
		<description><![CDATA[I found that the standard direct cannot redirect the output of the &#8220;set -x&#8221;, following is two methods to redirect output for &#8220;set -x&#8221; by google and my co-worker: 1: ./test.sh > test.log 2>&#038;1 2: test.sh 2>&#038;1 &#124; tee -a &#8230; <a href="http://www.52nlp.com/two-methods-to-redirect-output-for-set-x/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.52nlp.com/error-join-multi-character-tab-t-for-using-join-tab/' rel='bookmark' title='Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab'>Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab</a></li>
<li><a href='http://www.52nlp.com/nohup-and-screen/' rel='bookmark' title='&#8220;Nohup&#8221; and &#8220;Screen&#8221;'>&#8220;Nohup&#8221; and &#8220;Screen&#8221;</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-note-that-regr-test-for-ptable-filtering-fails/' rel='bookmark' title='Moses Support Digest: Note that regr. test for ptable-filtering fails'>Moses Support Digest: Note that regr. test for ptable-filtering fails</a></li>
<li><a href='http://www.52nlp.com/set-x-prints-executed-commands-and-their-arguments/' rel='bookmark' title='&#8220;set -x&#8221;: Prints executed commands and their arguments'>&#8220;set -x&#8221;: Prints executed commands and their arguments</a></li>
<li><a href='http://www.52nlp.com/how-to-start-new-process-or-run-shell-commands-within-python/' rel='bookmark' title='How to start new process or run shell commands within python?'>How to start new process or run shell commands within python?</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-createberkeleypt-and-on-disk-rule-table/' rel='bookmark' title='Moses Support Digest:CreateBerkeleyPt and On-Disk Rule Table'>Moses Support Digest:CreateBerkeleyPt and On-Disk Rule Table</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-seems-to-hang/' rel='bookmark' title='Moses Support Digest: Moses seems to hang'>Moses Support Digest: Moses seems to hang</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-threads-compilation-problem-with-randlm/' rel='bookmark' title='Moses Support Digest:moses threads compilation problem with RandLM'>Moses Support Digest:moses threads compilation problem with RandLM</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-binarized-srilm/' rel='bookmark' title='Moses Support Digest:Binarized SRILM'>Moses Support Digest:Binarized SRILM</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-alignment-information-from-binary-phrase-table/' rel='bookmark' title='Moses Support Digest:Alignment information from binary phrase table'>Moses Support Digest:Alignment information from binary phrase table</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I found that the standard direct cannot redirect the output of the &#8220;set -x&#8221;, following is two methods to redirect output for &#8220;set -x&#8221; by google and my co-worker:</p>
<p>1: ./test.sh > test.log 2>&#038;1</p>
<p>2: test.sh 2>&#038;1 | tee -a test.log</p>
<p>About &#8220;tee&#8221; from linux man page:</p>
<blockquote><p>Name<br />
tee &#8211; read from standard input and write to standard output and files<br />
Synopsis<br />
tee [OPTION]&#8230; [FILE]&#8230;<br />
Description</p>
<p>Copy standard input to each FILE, and also to standard output.<br />
-a, &#8211;append<br />
append to the given FILEs, do not overwrite<br />
-i, &#8211;ignore-interrupts<br />
ignore interrupt signals<br />
&#8211;help<br />
display this help and exit<br />
&#8211;version<br />
output version information and exit<br />
If a FILE is -, copy again to standard output.<br />
Author<br />
Written by Mike Parker, Richard M. Stallman, and David MacKenzie.<br />
Reporting Bugs<br />
Report bugs to <bug-coreutils@gnu.org>.<br />
Copyright<br />
Copyright � 2006 Free Software Foundation, Inc.This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.<br />
See Also<br />
The full documentation for tee is maintained as a Texinfo manual. If the info and tee programs are properly installed at your site, the command<br />
info tee<br />
should give you access to the complete manual.<br />
Referenced By<br />
auto-build(1), pee(1), tee(2), tpipe(1) </p></blockquote>
<p>Posted by <a href="http://www.52nlp.com/">52nlp</a></p>
<p>Related posts:<ol>
<li><a href='http://www.52nlp.com/error-join-multi-character-tab-t-for-using-join-tab/' rel='bookmark' title='Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab'>Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab</a></li>
<li><a href='http://www.52nlp.com/nohup-and-screen/' rel='bookmark' title='&#8220;Nohup&#8221; and &#8220;Screen&#8221;'>&#8220;Nohup&#8221; and &#8220;Screen&#8221;</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-note-that-regr-test-for-ptable-filtering-fails/' rel='bookmark' title='Moses Support Digest: Note that regr. test for ptable-filtering fails'>Moses Support Digest: Note that regr. test for ptable-filtering fails</a></li>
<li><a href='http://www.52nlp.com/set-x-prints-executed-commands-and-their-arguments/' rel='bookmark' title='&#8220;set -x&#8221;: Prints executed commands and their arguments'>&#8220;set -x&#8221;: Prints executed commands and their arguments</a></li>
<li><a href='http://www.52nlp.com/how-to-start-new-process-or-run-shell-commands-within-python/' rel='bookmark' title='How to start new process or run shell commands within python?'>How to start new process or run shell commands within python?</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-createberkeleypt-and-on-disk-rule-table/' rel='bookmark' title='Moses Support Digest:CreateBerkeleyPt and On-Disk Rule Table'>Moses Support Digest:CreateBerkeleyPt and On-Disk Rule Table</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-seems-to-hang/' rel='bookmark' title='Moses Support Digest: Moses seems to hang'>Moses Support Digest: Moses seems to hang</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-threads-compilation-problem-with-randlm/' rel='bookmark' title='Moses Support Digest:moses threads compilation problem with RandLM'>Moses Support Digest:moses threads compilation problem with RandLM</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-binarized-srilm/' rel='bookmark' title='Moses Support Digest:Binarized SRILM'>Moses Support Digest:Binarized SRILM</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-alignment-information-from-binary-phrase-table/' rel='bookmark' title='Moses Support Digest:Alignment information from binary phrase table'>Moses Support Digest:Alignment information from binary phrase table</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.52nlp.com/two-methods-to-redirect-output-for-set-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;set -x&#8221;: Prints executed commands and their arguments</title>
		<link>http://www.52nlp.com/set-x-prints-executed-commands-and-their-arguments/</link>
		<comments>http://www.52nlp.com/set-x-prints-executed-commands-and-their-arguments/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 06:30:22 +0000</pubDate>
		<dc:creator>52nlp</dc:creator>
				<category><![CDATA[Programming Skill]]></category>
		<category><![CDATA[Learning the bash Shell]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[set -x]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.52nlp.com/?p=418</guid>
		<description><![CDATA[I wrote a shell script and every time when I want print the executed commands and arguments I used the &#8220;echo&#8221; to echo the executed commands, this is not convenient. At the same time I use my co-worker&#8217;s shell script, &#8230; <a href="http://www.52nlp.com/set-x-prints-executed-commands-and-their-arguments/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.52nlp.com/how-to-start-new-process-or-run-shell-commands-within-python/' rel='bookmark' title='How to start new process or run shell commands within python?'>How to start new process or run shell commands within python?</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-the-results-of-your-email-commands/' rel='bookmark' title='Moses Support Digest:The results of your email commands'>Moses Support Digest:The results of your email commands</a></li>
<li><a href='http://www.52nlp.com/two-methods-to-redirect-output-for-set-x/' rel='bookmark' title='Two methods to redirect output for &#8220;set -x&#8221;'>Two methods to redirect output for &#8220;set -x&#8221;</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-decoder-results-on-cygwin-and-dos/' rel='bookmark' title='Moses Support Digest:moses decoder results on cygwin and dos'>Moses Support Digest:moses decoder results on cygwin and dos</a></li>
<li><a href='http://www.52nlp.com/nohup-and-screen/' rel='bookmark' title='&#8220;Nohup&#8221; and &#8220;Screen&#8221;'>&#8220;Nohup&#8221; and &#8220;Screen&#8221;</a></li>
<li><a href='http://www.52nlp.com/error-join-multi-character-tab-t-for-using-join-tab/' rel='bookmark' title='Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab'>Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab</a></li>
<li><a href='http://www.52nlp.com/moses-support-digestmert-extractor/' rel='bookmark' title='Moses Support Digest:mert extractor'>Moses Support Digest:mert extractor</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I wrote a shell script and every time when I want print the executed commands and arguments I used the &#8220;echo&#8221; to echo the executed commands, this is not convenient. At the same time I use my co-worker&#8217;s shell script, I found that his script print a lot of useful infomation which including executed commands and arguments. I saw the shell code and very surprise there is a few echo. I&#8217;m not familar with shell but found that he used &#8220;set -x&#8221; at every script begining. So I google the &#8220;set -x&#8221;:</p>
<p>set -x: Prints executed commands and their arguments</p>
<p>For me, one &#8220;set -x&#8221; can replace of many &#8220;echo&#8221;s and it seems that I should learn the shell scrpit systematic, &#8220;<a href="http://oreilly.com/catalog/9780596009656">Learning the bash Shell, Third Edition</a>&#8221; may be the best choice for me:</p>
<blockquote><p>This refreshed edition serves as the most valuable guide yet to the bash shell. It&#8217;s full of practical examples of shell commands and programs guaranteed to make everyday use of Linux that much easier. Includes information on key bindings, command line editing and processing, integrated programming features, signal handling, and much more! </p></blockquote>
<p>Posted by <a href="http://www.52nlp.com/">52nlp</a></p>
<p>Related posts:<ol>
<li><a href='http://www.52nlp.com/how-to-start-new-process-or-run-shell-commands-within-python/' rel='bookmark' title='How to start new process or run shell commands within python?'>How to start new process or run shell commands within python?</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-the-results-of-your-email-commands/' rel='bookmark' title='Moses Support Digest:The results of your email commands'>Moses Support Digest:The results of your email commands</a></li>
<li><a href='http://www.52nlp.com/two-methods-to-redirect-output-for-set-x/' rel='bookmark' title='Two methods to redirect output for &#8220;set -x&#8221;'>Two methods to redirect output for &#8220;set -x&#8221;</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-decoder-results-on-cygwin-and-dos/' rel='bookmark' title='Moses Support Digest:moses decoder results on cygwin and dos'>Moses Support Digest:moses decoder results on cygwin and dos</a></li>
<li><a href='http://www.52nlp.com/nohup-and-screen/' rel='bookmark' title='&#8220;Nohup&#8221; and &#8220;Screen&#8221;'>&#8220;Nohup&#8221; and &#8220;Screen&#8221;</a></li>
<li><a href='http://www.52nlp.com/error-join-multi-character-tab-t-for-using-join-tab/' rel='bookmark' title='Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab'>Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab</a></li>
<li><a href='http://www.52nlp.com/moses-support-digestmert-extractor/' rel='bookmark' title='Moses Support Digest:mert extractor'>Moses Support Digest:mert extractor</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.52nlp.com/set-x-prints-executed-commands-and-their-arguments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to start new process or run shell commands within python?</title>
		<link>http://www.52nlp.com/how-to-start-new-process-or-run-shell-commands-within-python/</link>
		<comments>http://www.52nlp.com/how-to-start-new-process-or-run-shell-commands-within-python/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 11:17:46 +0000</pubDate>
		<dc:creator>52nlp</dc:creator>
				<category><![CDATA[Programming Skill]]></category>
		<category><![CDATA[commands module]]></category>
		<category><![CDATA[os.popen]]></category>
		<category><![CDATA[os.system]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[subprocess module]]></category>

		<guid isPermaLink="false">http://www.52nlp.com/?p=407</guid>
		<description><![CDATA[Starting new process or running shell commands is a common task in python and there are many ways to excute this process. After google the problem in the web, I found the summary of the “start new process or run &#8230; <a href="http://www.52nlp.com/how-to-start-new-process-or-run-shell-commands-within-python/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.52nlp.com/set-x-prints-executed-commands-and-their-arguments/' rel='bookmark' title='&#8220;set -x&#8221;: Prints executed commands and their arguments'>&#8220;set -x&#8221;: Prints executed commands and their arguments</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-decoder-on-windows-freezes-after-5-sentences/' rel='bookmark' title='Moses Support Digest: Moses decoder on windows freezes after 5 sentences'>Moses Support Digest: Moses decoder on windows freezes after 5 sentences</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-the-results-of-your-email-commands/' rel='bookmark' title='Moses Support Digest:The results of your email commands'>Moses Support Digest:The results of your email commands</a></li>
<li><a href='http://www.52nlp.com/nohup-and-screen/' rel='bookmark' title='&#8220;Nohup&#8221; and &#8220;Screen&#8221;'>&#8220;Nohup&#8221; and &#8220;Screen&#8221;</a></li>
<li><a href='http://www.52nlp.com/error-join-multi-character-tab-t-for-using-join-tab/' rel='bookmark' title='Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab'>Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab</a></li>
<li><a href='http://www.52nlp.com/two-methods-to-redirect-output-for-set-x/' rel='bookmark' title='Two methods to redirect output for &#8220;set -x&#8221;'>Two methods to redirect output for &#8220;set -x&#8221;</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-error-compiling-on-linux/' rel='bookmark' title='Moses Support Digest:Error compiling on Linux'>Moses Support Digest:Error compiling on Linux</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Starting new process or running shell commands is a common task in python and there are many ways to excute this process. After google the problem in the web, I found the summary of the “start new process or run shell commands within python” is messy. Following is my summary of this problem in python, which include os.system(), os.popen(), commands module and subprocess module. It references some materials from the web and I will keep it here as a note.</p>
<p><strong>1. os.system(command)</strong></p>
<blockquote><p> Execute the command (a string) in a subshell. This is implemented by calling the Standard C function system(), and has the same limitations. Changes to sys.stdin, etc. are not reflected in the environment of the executed command.</p>
<p>    On Unix, the return value is the exit status of the process encoded in the format specified for wait(). Note that POSIX does not specify the meaning of the return value of the C system() function, so the return value of the Python function is system-dependent.</p>
<p>    On Windows, the return value is that returned by the system shell after running command, given by the Windows environment variable COMSPEC: on command.com systems (Windows 95, 98 and ME) this is always 0; on cmd.exe systems (Windows NT, 2000 and XP) this is the exit status of the command run; on systems using a non-native shell, consult your shell documentation.</p>
<p>    The subprocess module provides more powerful facilities for spawning new processes and retrieving their results; using that module is preferable to using this function. See the Replacing Older Functions with the subprocess Module section in the subprocess documentation for some helpful recipes.</p></blockquote>
<p>os.system(command) is the first way to run shell commands within python I found and it is simple:<br />
…<br />
>>> import os<br />
>>> os.system(&#8220;md5sum –c file.md5&#8243;)<br />
file: OK<br />
0<br />
…<br />
Here the “0” is the return value of os.system(&#8220;md5sum –c file&#8221;), which is the exit status of the process encoded in the format specified for wait(). Note that POSIX does not specify the meaning of the return value of the C system() function, so the return value of the Python function is system-dependent. But I need the “OK” to notice the python program to execute the next step, so os.system() is not my first choice.<br />
<span id="more-407"></span><br />
<strong>2. os.popen(command[, mode[, bufsize]])</strong></p>
<blockquote><p>Open a pipe to or from command. The return value is an open file object connected to the pipe, which can be read or written depending on whether mode is &#8216;r&#8217; (default) or &#8216;w&#8217;. The bufsize argument has the same meaning as the corresponding argument to the built-in open() function. The exit status of the command (encoded in the format specified for wait()) is available as the return value of the close() method of the file object, except that when the exit status is zero (termination without errors), None is returned.</p></blockquote>
<p>…<br />
>>> ret = os.popen(&#8216;md5sum -c file.md5&#8242;)<br />
>>> ret<br />
&lt;open file &#8216;md5sum -c file.md5&#8242;, mode &#8216;r&#8217; at 0x2b5a79b5cd50&gt;<br />
>>> dir(ret)<br />
['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__iter__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', 'close', 'closed', 'encoding', 'fileno', 'flush', 'isatty', 'mode', 'name', 'newlines', 'next', 'read', 'readinto', 'readline', 'readlines', 'seek', 'softspace', 'tell', 'truncate', 'write', 'writelines', 'xreadlines']<br />
>>> print ret.readline()<br />
file.data: OK<br />
…<br />
It seems that os.popen() can be used by my python program, cause the return value include the “OK” status. But can we have a better choice?</p>
<p><strong>3. commands module — Utilities for running commands</strong></p>
<blockquote><p>Platforms: Unix</p>
<p>The commands module contains wrapper functions for os.popen() which take a system command as a string and return any output generated by the command and, optionally, the exit status.</p>
<p>The subprocess module provides more powerful facilities for spawning new processes and retrieving their results. Using the subprocess module is preferable to using the commands module.</p>
<p>Note</p>
<p>In Python 3.x, getstatus() and two undocumented functions (mk2arg() and mkarg()) have been removed. Also, getstatusoutput() and getoutput() have been moved to the subprocess module.</p>
<p>The commands module defines the following functions:</p>
<p>commands.getstatusoutput(cmd)<br />
    Execute the string cmd in a shell with os.popen() and return a 2-tuple (status, output). cmd is actually run as { cmd ; } 2>&#038;1, so that the returned output will contain output or error messages. A trailing newline is stripped from the output. The exit status for the command can be interpreted according to the rules for the C function wait().</p>
<p>commands.getoutput(cmd)<br />
    Like getstatusoutput(), except the exit status is ignored and the return value is a string containing the command’s output.</p>
<p>commands.getstatus(file)</p>
<p>    Return the output of ls -ld file as a string. This function uses the getoutput() function, and properly escapes backslashes and dollar signs in the argument.</p>
<p>    Deprecated since version 2.6: This function is nonobvious and useless. The name is also misleading in the presence of getstatusoutput().</p>
<p>Example:</p>
<p>>>> import commands<br />
>>> commands.getstatusoutput(&#8216;ls /bin/ls&#8217;)<br />
(0, &#8216;/bin/ls&#8217;)<br />
>>> commands.getstatusoutput(&#8216;cat /bin/junk&#8217;)<br />
(256, &#8216;cat: /bin/junk: No such file or directory&#8217;)<br />
>>> commands.getstatusoutput(&#8216;/bin/junk&#8217;)<br />
(256, &#8216;sh: /bin/junk: not found&#8217;)<br />
>>> commands.getoutput(&#8216;ls /bin/ls&#8217;)<br />
&#8216;/bin/ls&#8217;<br />
>>> commands.getstatus(&#8216;/bin/ls&#8217;)<br />
&#8216;-rwxr-xr-x  1 root        13352 Oct 14  1994 /bin/ls&#8217;
</p></blockquote>
<p>For my problem, the commands.getstatusoutput() can meet my needs:<br />
…<br />
>>> import commands<br />
>>> ret1, ret2 = commands.getstatusoutput(&#8216;md5sum -c file.md5&#8242;)<br />
>>> print ret1, ret2<br />
0 file: OK<br />
…<br />
But “Deprecated since version 2.6: The commands module has been removed in Python 3.0. Use the subprocess module instead”, so it is time to see the subprocess module.</p>
<p><strong>4. subprocess module— Subprocess management</strong></p>
<blockquote><p>The subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes. This module intends to replace several other, older modules and functions, such as:</p>
<p>os.system<br />
os.spawn*<br />
os.popen*<br />
popen2.*<br />
commands.*</p>
<p>This module defines one class called Popen:</p>
<p>        class Popen(args, bufsize=0, executable=None,<br />
                    stdin=None, stdout=None, stderr=None,<br />
                    preexec_fn=None, close_fds=False, shell=False,<br />
                    cwd=None, env=None, universal_newlines=False,<br />
                    startupinfo=None, creationflags=0):</p>
<p>      Arguments are:</p>
<p>    &#8211; args should be a string, or a sequence of program arguments.<br />
      The program to execute is normally the first item in the args<br />
      sequence or string, but can be explicitly set by using the<br />
      executable argument.</p>
<p>      On UNIX, with shell=False (default): In this case, the Popen<br />
      class uses os.execvp() to execute the child program.  args<br />
      should normally be a sequence.  A string will be treated as a<br />
      sequence with the string as the only item (the program to<br />
      execute).</p>
<p>      On UNIX, with shell=True: If args is a string, it specifies the<br />
      command string to execute through the shell.  If args is a<br />
      sequence, the first item specifies the command string, and any<br />
      additional items will be treated as additional shell arguments.</p>
<p>      On Windows: the Popen class uses CreateProcess() to execute the<br />
      child program, which operates on strings.  If args is a<br />
      sequence, it will be converted to a string using the<br />
      list2cmdline method.  Please note that not all MS Windows<br />
      applications interpret the command line the same way: The<br />
      list2cmdline is designed for applications using the same rules<br />
      as the MS C runtime.</p>
<p>    &#8211; bufsize, if given, has the same meaning as the corresponding<br />
      argument to the built-in open() function: 0 means unbuffered, 1<br />
      means line buffered, any other positive value means use a buffer<br />
      of (approximately) that size.  A negative bufsize means to use<br />
      the system default, which usually means fully buffered.  The<br />
      default value for bufsize is 0 (unbuffered).</p>
<p>    &#8211; stdin, stdout and stderr specify the executed programs&#8217; standard<br />
      input, standard output and standard error file handles,<br />
      respectively.  Valid values are PIPE, an existing file<br />
      descriptor (a positive integer), an existing file object, and<br />
      None.  PIPE indicates that a new pipe to the child should be<br />
      created.  With None, no redirection will occur; the child&#8217;s file<br />
      handles will be inherited from the parent.  Additionally, stderr<br />
      can be STDOUT, which indicates that the stderr data from the<br />
      applications should be captured into the same file handle as for<br />
      stdout.</p>
<p>    &#8211; If preexec_fn is set to a callable object, this object will be<br />
      called in the child process just before the child is executed.</p>
<p>    &#8211; If close_fds is true, all file descriptors except 0, 1 and 2<br />
      will be closed before the child process is executed.</p>
<p>    &#8211; If shell is true, the specified command will be executed through<br />
      the shell.  </p>
<p>    &#8211; If cwd is not None, the current directory will be changed to cwd<br />
      before the child is executed.</p>
<p>    &#8211; If env is not None, it defines the environment variables for the<br />
      new process.</p>
<p>    &#8211; If universal_newlines is true, the file objects stdout and<br />
      stderr are opened as a text file, but lines may be terminated<br />
      by any of &#8216;n&#8217;, the Unix end-of-line convention, &#8216;r&#8217;, the<br />
      Macintosh convention or &#8216;rn&#8217;, the Windows convention.  All of<br />
      these external representations are seen as &#8216;n&#8217; by the Python<br />
      program.  Note: This feature is only available if Python is<br />
      built with universal newline support (the default).  Also, the<br />
      newlines attribute of the file objects stdout, stdin and stderr<br />
      are not updated by the communicate() method.</p>
<p>    &#8211; The startupinfo and creationflags, if given, will be passed to<br />
      the underlying CreateProcess() function.  They can specify<br />
      things such as appearance of the main window and priority for<br />
      the new process.  (Windows only)</p>
<p>      This module also defines two shortcut functions:</p>
<p>    &#8211; call(*args, **kwargs):<br />
          Run command with arguments.  Wait for command to complete,<br />
          then return the returncode attribute.</p>
<p>          The arguments are the same as for the Popen constructor.<br />
          Example:</p>
<p>          retcode = call(["ls", "-l"])</p></blockquote>
<p>For my problem, I use the following code to replace the os.popen():</p>
<p>…<br />
>>> from subprocess import Popen, PIPE<br />
>>> ret = Popen(&#8220;md5sum -c file.md5&#8243;, shell=True, stdout=PIPE).stdout<br />
>>> dir(ret)<br />
['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__iter__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', 'close', 'closed', 'encoding', 'fileno', 'flush', 'isatty', 'mode', 'name', 'newlines', 'next', 'read', 'readinto', 'readline', 'readlines', 'seek', 'softspace', 'tell', 'truncate', 'write', 'writelines', 'xreadlines']<br />
>>> print ret.read()<br />
file: OK<br />
…</p>
<p><strong>References:</strong><br />
<a href="http://docs.python.org/library/os.html">http://docs.python.org/library/os.html</a><br />
<a href="http://docs.python.org/library/commands.html">http://docs.python.org/library/commands.html</a><br />
<a href="http://docs.python.org/library/subprocess.html">http://docs.python.org/library/subprocess.html</a><br />
<a href="http://www.python.org/dev/peps/pep-0324/">http://www.python.org/dev/peps/pep-0324/</a></p>
<p>Post by <a href="http://www.52nlp.com">52nlp</a></p>
<p>Related posts:<ol>
<li><a href='http://www.52nlp.com/set-x-prints-executed-commands-and-their-arguments/' rel='bookmark' title='&#8220;set -x&#8221;: Prints executed commands and their arguments'>&#8220;set -x&#8221;: Prints executed commands and their arguments</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-decoder-on-windows-freezes-after-5-sentences/' rel='bookmark' title='Moses Support Digest: Moses decoder on windows freezes after 5 sentences'>Moses Support Digest: Moses decoder on windows freezes after 5 sentences</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-the-results-of-your-email-commands/' rel='bookmark' title='Moses Support Digest:The results of your email commands'>Moses Support Digest:The results of your email commands</a></li>
<li><a href='http://www.52nlp.com/nohup-and-screen/' rel='bookmark' title='&#8220;Nohup&#8221; and &#8220;Screen&#8221;'>&#8220;Nohup&#8221; and &#8220;Screen&#8221;</a></li>
<li><a href='http://www.52nlp.com/error-join-multi-character-tab-t-for-using-join-tab/' rel='bookmark' title='Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab'>Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab</a></li>
<li><a href='http://www.52nlp.com/two-methods-to-redirect-output-for-set-x/' rel='bookmark' title='Two methods to redirect output for &#8220;set -x&#8221;'>Two methods to redirect output for &#8220;set -x&#8221;</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-error-compiling-on-linux/' rel='bookmark' title='Moses Support Digest:Error compiling on Linux'>Moses Support Digest:Error compiling on Linux</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.52nlp.com/how-to-start-new-process-or-run-shell-commands-within-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mean Absolute Error (MAE) and Mean Square Error (MSE)</title>
		<link>http://www.52nlp.com/mean-absolute-error-mae-and-mean-square-error-mse/</link>
		<comments>http://www.52nlp.com/mean-absolute-error-mae-and-mean-square-error-mse/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 07:31:21 +0000</pubDate>
		<dc:creator>52nlp</dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[MAE]]></category>
		<category><![CDATA[Mean Absolute Error]]></category>
		<category><![CDATA[Mean Square Error]]></category>
		<category><![CDATA[MSE]]></category>

		<guid isPermaLink="false">http://www.52nlp.com/?p=397</guid>
		<description><![CDATA[I need to calculate the MAE and MSE value for a model we trained, following is the summary of Mean Absolute Error (MAE) and Mean Square Error (MSE) from the wikipedia and other web site which I make a note &#8230; <a href="http://www.52nlp.com/mean-absolute-error-mae-and-mean-square-error-mse/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.52nlp.com/moses-support-mt3_chart-compilation-error-mt3_chart-compilation-error/' rel='bookmark' title='Moses Support Digest:mt3_chart compilation error'>Moses Support Digest:mt3_chart compilation error</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-chart-error-while-compiling-training-scripts/' rel='bookmark' title='Moses Support Digest: moses-chart error while compiling training scripts'>Moses Support Digest: moses-chart error while compiling training scripts</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-confusionnet-getsubstring-error-when-using-lattice-with-utf8-input/' rel='bookmark' title='Moses Support Digest:ConfusionNet GetSubString error when using lattice with UTF8 input'>Moses Support Digest:ConfusionNet GetSubString error when using lattice with UTF8 input</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-giza-error/' rel='bookmark' title='Moses Support Digest:GIZA++ error'>Moses Support Digest:GIZA++ error</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-error-compiling-on-linux/' rel='bookmark' title='Moses Support Digest:Error compiling on Linux'>Moses Support Digest:Error compiling on Linux</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I need to calculate the MAE and MSE value for a model we trained, following is the summary of  Mean Absolute Error (MAE) and Mean Square Error (MSE) from the wikipedia and other web site which I make a note here.  </p>
<p><strong>Mean Absolute Error (MAE):</strong><br />
In statistics, the mean absolute error is a quantity used to measure how close forecasts or predictions are to the eventual outcomes. The mean absolute error (MAE) is given by</p>
<p><img src="http://rpmedia.ask.com/ts?u=/math/2/9/7/297749876ee4d83359add9f486a4021b.png" alt="MAE" /></p>
<p>As the name suggests, the mean absolute error is an average of the absolute errors ei = fi − yi, where fi is the prediction and yi the true value. Note that alternative formulations may include relative frequencies as weight factors.</p>
<p>The mean absolute error is a common measure of forecast error in time series analysis, where the terms &#8220;mean absolute deviation&#8221; is sometimes used in confusion with the more standard definition of mean absolute deviation. The same confusion exists more generally.</p>
<p>The MAE measures the average magnitude of the errors in a set of forecasts, without considering their direction. It measures accuracy for continuous variables. The equation is given in the library references. Expressed in words, the MAE is the average over the verification sample of the absolute values of the differences between forecast and the corresponding observation. The MAE is a linear score which means that all the individual differences are weighted equally in the average. </p>
<p><strong>Mean Square Error (MSE):</strong><br />
In statistics, the mean square error or MSE of an estimator is one of many ways to quantify the difference between an estimator and the true value of the quantity being estimated. MSE is a risk function, corresponding to the expected value of the squared error loss or quadratic loss. MSE measures the average of the square of the &#8220;error.&#8221; The error is the amount by which the estimator differs from the quantity to be estimated. The difference occurs because of randomness or because the estimator doesn&#8217;t account for information that could produce a more accurate estimate.</p>
<p>The MSE is the second moment (about the origin) of the error, and thus incorporates both the variance of the estimator and its bias. For an unbiased estimator, the MSE is the variance. Like the variance, MSE has the same unit of measurement as the square of the quantity being estimated. In an analogy to standard deviation, taking the square root of MSE yields the root mean squared error or RMSE, which has the same units as the quantity being estimated; for an unbiased estimator, the RMSE is the square root of the variance, known as the standard error.</p>
<p><em>Definition and basic properties</em></p>
<p>The MSE of an estimator   with respect to the estimated parameter θ is defined as</p>
<p><img src="http://rpmedia.ask.com/ts?u=/math/0/2/c/02c8a249849cbeb1f56345909591ea5c.png" alt="MSE" /></p>
<p>The MSE is equal to the sum of the variance and the squared bias of the estimator</p>
<p><img src="http://rpmedia.ask.com/ts?u=/math/5/4/3/5436c8c5bc035152cd36378d42e253a8.png" alt="mse" /></p>
<p>The MSE thus assesses the quality of an estimator in terms of its variation and unbiasedness. Note that the MSE is not equivalent to the expected value of the absolute error.</p>
<p>Since MSE is an expectation, it is a scalar, and not a random variable. It may be a function of the unknown parameter θ , but it does not depend on any random quantities. However, when MSE is computed for a particular estimator of θ the true value of which is not known, it will be subject to estimation error. In a Bayesian sense, this means that there are cases in which it may be treated as a random variable.</p>
<p><em>Alternative usage</em></p>
<p>The term mean squared error is sometimes used to refer to residual sum of squares, divided by the number of degrees of freedom. This is an observed quantity, whereas the definition above is a function of an often unknown parameter. For more details, see errors and residuals in statistics.</p>
<p>Posted by <a href="http://www.52nlp.com/">52nlp</a></p>
<p>Related posts:<ol>
<li><a href='http://www.52nlp.com/moses-support-mt3_chart-compilation-error-mt3_chart-compilation-error/' rel='bookmark' title='Moses Support Digest:mt3_chart compilation error'>Moses Support Digest:mt3_chart compilation error</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-chart-error-while-compiling-training-scripts/' rel='bookmark' title='Moses Support Digest: moses-chart error while compiling training scripts'>Moses Support Digest: moses-chart error while compiling training scripts</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-confusionnet-getsubstring-error-when-using-lattice-with-utf8-input/' rel='bookmark' title='Moses Support Digest:ConfusionNet GetSubString error when using lattice with UTF8 input'>Moses Support Digest:ConfusionNet GetSubString error when using lattice with UTF8 input</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-giza-error/' rel='bookmark' title='Moses Support Digest:GIZA++ error'>Moses Support Digest:GIZA++ error</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-error-compiling-on-linux/' rel='bookmark' title='Moses Support Digest:Error compiling on Linux'>Moses Support Digest:Error compiling on Linux</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.52nlp.com/mean-absolute-error-mae-and-mean-square-error-mse/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>&#8220;Nohup&#8221; and &#8220;Screen&#8221;</title>
		<link>http://www.52nlp.com/nohup-and-screen/</link>
		<comments>http://www.52nlp.com/nohup-and-screen/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 05:56:18 +0000</pubDate>
		<dc:creator>52nlp</dc:creator>
				<category><![CDATA[Programming Skill]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[nohup]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[skill]]></category>

		<guid isPermaLink="false">http://www.52nlp.com/?p=395</guid>
		<description><![CDATA[&#8220;Nohup&#8221; and &#8220;Screen&#8221; can be used to run a command even if the session is disconnected or the user logs out. I use them both, but &#8220;Screen&#8221; is better. What is nohup? As the man page states: &#8220;nohup &#8211; run &#8230; <a href="http://www.52nlp.com/nohup-and-screen/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.52nlp.com/moses-support-digest-the-problem-with-the-installation-of-moses-on-windows-xp/' rel='bookmark' title='Moses Support Digest: The problem with the installation of Moses on Windows XP'>Moses Support Digest: The problem with the installation of Moses on Windows XP</a></li>
<li><a href='http://www.52nlp.com/how-to-start-new-process-or-run-shell-commands-within-python/' rel='bookmark' title='How to start new process or run shell commands within python?'>How to start new process or run shell commands within python?</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-processphrasetable-in-windows/' rel='bookmark' title='Moses Support Digest: processPhraseTable in windows'>Moses Support Digest: processPhraseTable in windows</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-translation-from-english-to-foreign-language/' rel='bookmark' title='Moses Support Digest:Translation from English to Foreign Language'>Moses Support Digest:Translation from English to Foreign Language</a></li>
<li><a href='http://www.52nlp.com/error-join-multi-character-tab-t-for-using-join-tab/' rel='bookmark' title='Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab'>Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-decoder-on-windows-freezes-after-5-sentences/' rel='bookmark' title='Moses Support Digest: Moses decoder on windows freezes after 5 sentences'>Moses Support Digest: Moses decoder on windows freezes after 5 sentences</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>&#8220;Nohup&#8221; and &#8220;Screen&#8221; can be used to run a command even if the session is disconnected or the user logs out. I use them both, but &#8220;Screen&#8221; is better.</p>
<p><strong>What is nohup? As the man page states:</strong></p>
<p>&#8220;nohup &#8211; run a command immune to hangups, with output to a non-tty<br />
Synopsis. Run COMMAND, ignoring hangup signals.&#8221; </p>
<p>How to use nohup:<br />
$nohup ./command.sh &#038;<br />
then the shell show:<br />
[~]$ appending output to nohup.out<br />
enter it and the nohup.out will save the output.</p>
<p><strong>What is screen? As the man page states:</strong></p>
<p>&#8220;Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells). Each virtual terminal provides the functions of a DEC VT100 terminal and, in addition, several control functions from the ISO 6429 (ECMA 48, ANSI X3.64) and ISO 2022 standards (e.g. insert/delete line and support for multiple character sets). There is a scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows moving text regions between windows.</p>
<p>When screen is called, it creates a single window with a shell in it (or the specified command) and then gets out of your way so that you can use the program as you normally would. Then, at any time, you can create new (full-screen) windows with other programs in them (including more shells), kill existing windows, view a list of windows, turn output logging on and off, copy-and-paste text between windows, view the scrollback history, switch between windows in whatever manner you wish, etc. All windows run their programs completely independent of each other. Programs continue to run when their window is currently not visible and even when the whole screen session is detached from the user&#8217;s terminal. When a program terminates, screen (per default) kills the window that contained it. If this window was in the foreground, the display switches to the previous window; if none are left, screen exits.&#8221;</p>
<p>How to use screen?<br />
1. creat a task:<br />
$ screen -S task<br />
2. Execute a command in the task window，if your task not finished, use<br />
$ Ctrl+a+d<br />
to save the task. It will show the following info:<br />
[detached]                             </p>
<p>if your task has been finished, use &#8220;exit&#8221; to exit screen:<br />
$ exit<br />
[screen is terminating]</p>
<p>3. You can use &#8220;screen -ls&#8221; to find any screen info:<br />
$ screen -ls<br />
There is a screen on:<br />
10000.task   (Detached)</p>
<p>4. Use &#8220;screen -r&#8221; to recover the task:<br />
$ screen -r 10000</p>
<p>Posted by <a href="http://www.52nlp.com/">52nlp</a></p>
<p>Related posts:<ol>
<li><a href='http://www.52nlp.com/moses-support-digest-the-problem-with-the-installation-of-moses-on-windows-xp/' rel='bookmark' title='Moses Support Digest: The problem with the installation of Moses on Windows XP'>Moses Support Digest: The problem with the installation of Moses on Windows XP</a></li>
<li><a href='http://www.52nlp.com/how-to-start-new-process-or-run-shell-commands-within-python/' rel='bookmark' title='How to start new process or run shell commands within python?'>How to start new process or run shell commands within python?</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-processphrasetable-in-windows/' rel='bookmark' title='Moses Support Digest: processPhraseTable in windows'>Moses Support Digest: processPhraseTable in windows</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-translation-from-english-to-foreign-language/' rel='bookmark' title='Moses Support Digest:Translation from English to Foreign Language'>Moses Support Digest:Translation from English to Foreign Language</a></li>
<li><a href='http://www.52nlp.com/error-join-multi-character-tab-t-for-using-join-tab/' rel='bookmark' title='Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab'>Error &#8220;join: multi-character tab `\\t&#8217;&#8221; for using join tab</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-decoder-on-windows-freezes-after-5-sentences/' rel='bookmark' title='Moses Support Digest: Moses decoder on windows freezes after 5 sentences'>Moses Support Digest: Moses decoder on windows freezes after 5 sentences</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.52nlp.com/nohup-and-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reference of Scheme or Lisp</title>
		<link>http://www.52nlp.com/reference-of-scheme-or-lisp/</link>
		<comments>http://www.52nlp.com/reference-of-scheme-or-lisp/#comments</comments>
		<pubDate>Sun, 07 Nov 2010 10:24:59 +0000</pubDate>
		<dc:creator>52nlp</dc:creator>
				<category><![CDATA[Programming Skill]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[programming language]]></category>
		<category><![CDATA[scheme]]></category>

		<guid isPermaLink="false">http://www.52nlp.com/?p=392</guid>
		<description><![CDATA[This is the reference of scheme or lisp which recommended by Dr. Wang: 1. The Origin of Scheme programming language: http://groups.csail.mit.edu/mac/projects/scheme/ 2. Compiler and Interpreter http://www.gnu.org/software/mit-scheme/ 3. Learning Materials http://www.scheme.com/tspl3/ 4. The Mathematical Model behind the Lisp Language http://www.inf.fu-berlin.de/lehre/WS03/alpi/lambda.pdf About &#8230; <a href="http://www.52nlp.com/reference-of-scheme-or-lisp/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.52nlp.com/set-x-prints-executed-commands-and-their-arguments/' rel='bookmark' title='&#8220;set -x&#8221;: Prints executed commands and their arguments'>&#8220;set -x&#8221;: Prints executed commands and their arguments</a></li>
<li><a href='http://www.52nlp.com/two-methods-to-redirect-output-for-set-x/' rel='bookmark' title='Two methods to redirect output for &#8220;set -x&#8221;'>Two methods to redirect output for &#8220;set -x&#8221;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This is the reference of scheme or lisp which recommended by Dr. Wang:</p>
<p>1. The Origin of Scheme programming language:<br />
<a href="http://groups.csail.mit.edu/mac/projects/scheme/"target=_blank>http://groups.csail.mit.edu/mac/projects/scheme/</a></p>
<p>2. Compiler and Interpreter<br />
<a href="http://www.gnu.org/software/mit-scheme/"target=_blank>http://www.gnu.org/software/mit-scheme/</a></p>
<p>3. Learning Materials<br />
<a href="http://www.scheme.com/tspl3/"target=_blank>http://www.scheme.com/tspl3/</a></p>
<p>4. The Mathematical Model behind the Lisp Language<br />
<a href="http://www.inf.fu-berlin.de/lehre/WS03/alpi/lambda.pdf"target=_blank>http://www.inf.fu-berlin.de/lehre/WS03/alpi/lambda.pdf</a></p>
<p><strong>About Secheme (from Wikipedia):</strong><br />
Scheme is one of the two main dialects of the programming language Lisp. Unlike Common Lisp, the other main dialect, Scheme follows a minimalist design philosophy specifying a small standard core with powerful tools for language extension. Its compactness and elegance have made it popular with educators, language designers, programmers, implementors, and hobbyists, and this diverse appeal is seen as both a strength and, because of the diversity of its constituencies and the wide divergence between implementations, one of its weaknesses.</p>
<p>Scheme was developed at the MIT AI Lab by Guy L. Steele and Gerald Jay Sussman who introduced it to the academic world via a series of memos, now referred to as the Lambda Papers, over the period 1975-1980. The Scheme language is standardized in the official IEEE standard, and a de facto standard called the Revisedn Report on the Algorithmic Language Scheme (RnRS). The most widely implemented standard is R5RS (1998), and a new standard R6RS was ratified in 2007.</p>
<p>Scheme was the first dialect of Lisp to choose lexical scope and the first to require implementations to perform tail-call optimization. It was also one of the first programming languages to support first-class continuations. It had a significant influence on the effort that led to the development of its sister, Common Lisp.</p>
<p>Posted by <a href="http://www.52nlp.com/">52nlp</a></p>
<p>Related posts:<ol>
<li><a href='http://www.52nlp.com/set-x-prints-executed-commands-and-their-arguments/' rel='bookmark' title='&#8220;set -x&#8221;: Prints executed commands and their arguments'>&#8220;set -x&#8221;: Prints executed commands and their arguments</a></li>
<li><a href='http://www.52nlp.com/two-methods-to-redirect-output-for-set-x/' rel='bookmark' title='Two methods to redirect output for &#8220;set -x&#8221;'>Two methods to redirect output for &#8220;set -x&#8221;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.52nlp.com/reference-of-scheme-or-lisp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google&#8217;s Protocol Buffers: Beautiful and Easy</title>
		<link>http://www.52nlp.com/googles-protocol-buffers-beautiful-and-easy/</link>
		<comments>http://www.52nlp.com/googles-protocol-buffers-beautiful-and-easy/#comments</comments>
		<pubDate>Sat, 30 Oct 2010 06:09:38 +0000</pubDate>
		<dc:creator>52nlp</dc:creator>
				<category><![CDATA[Programming Skill]]></category>
		<category><![CDATA[Berkeley DB]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google's Protocol Buffers]]></category>
		<category><![CDATA[Protocol Buffer]]></category>
		<category><![CDATA[Protocol Buffers]]></category>

		<guid isPermaLink="false">http://www.52nlp.com/?p=382</guid>
		<description><![CDATA[I met a problem when I want put “vector&#60;int&#62;” as data into the Berkeley DB, Dr. Wang told me Protocol Buffers may be one of the best choices. Before that time, Protocol Buffers for me like a stranger, cause I &#8230; <a href="http://www.52nlp.com/googles-protocol-buffers-beautiful-and-easy/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.52nlp.com/how-to-start-new-process-or-run-shell-commands-within-python/' rel='bookmark' title='How to start new process or run shell commands within python?'>How to start new process or run shell commands within python?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I met a problem when I want put “vector&lt;int&gt;” as data into the Berkeley DB, Dr. Wang told me Protocol Buffers may be one of the best choices. Before that time, Protocol Buffers for me like a stranger, cause I even didn’t listen about it. Now it’s time to learn Protocol Buffers. </p>
<p>First what are Protocol Buffers? Following is from the Official <a href="http://code.google.com/p/protobuf/"target=_blank>Google Code Home</a>: </p>
<p>Protocol buffers are Google&#8217;s language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages – Java, C++, or Python.</p>
<p>For details Google Protocol overview, I recommend you to ref:<br />
<a href="http://code.google.com/p/protobuf/"target=_blank>http://code.google.com/apis/protocolbuffers/docs/overview.html</a></p>
<p>Second how to start Protocol Buffers?<br />
Certainly you should download and install it first:<br />
<a href="http://code.google.com/p/protobuf/downloads/list"target=_blank>http://code.google.com/p/protobuf/downloads/list</a></p>
<p>Choose a proper package to download and install according the INSTALL.txt file in the package. The simplest way to compile this package for Linux platform is:<br />
  1. `cd&#8217; to the directory containing the package&#8217;s source code and type `./configure&#8217; to configure the package for your system.<br />
  2. Type `make&#8217; to compile the package.<br />
3. Optionally, type `make check&#8217; to run any self-tests that come with the package.<br />
4. Type `make install&#8217; to install the programs and any data files and documentation.<br />
5. You can remove the program binaries and object files from the source code directory by typing `make clean&#8217;.</p>
<p>Then you can use Google’s Protocol Buffers. I choose “Protocol Buffer Basics: C++” tutorial as the start: <a href="http://code.google.com/apis/protocolbuffers/docs/cpptutorial.html"target=_blank>http://code.google.com/apis/protocolbuffers/docs/cpptutorial.html</a>.</p>
<p>This tutorial provides a basic C++ programmer&#8217;s introduction to working with protocol buffers. By walking through creating a simple example application, it shows you how to<br />
•	Define message formats in a .proto file.<br />
•	Use the protocol buffer compiler.<br />
•	Use the C++ protocol buffer API to write and read messages. </p>
<p>This isn&#8217;t a comprehensive guide to using protocol buffers in C++. For more detailed reference information, see the Protocol Buffer Language Guide, the C++ API Reference, the C++ Generated Code Guide, and the Encoding Reference. </p>
<p>For my problem, first define an doc_id.proto:<br />
message DocId {<br />
  repeated int32 id = 1;<br />
}</p>
<p>Then compile it by the following command:<br />
protoc &#8211;cpp_out=./ doc_id.proto</p>
<p>This generates the following files in the same directory:<br />
•	doc_id.pb.h, the header which declares your generated classes.<br />
•	doc_id.pb.cc, which contains the implementation of your classes. </p>
<p>Now, my C++ program can include the doc_id.pb.h file and use the related Protocol Buffer API:<br />
  …<br />
  // repeated int32 id = 1;<br />
  inline int id_size() const;<br />
  inline void clear_id();<br />
  static const int kIdFieldNumber = 1;<br />
  inline ::google::protobuf::int32 id(int index) const;<br />
  inline void set_id(int index, ::google::protobuf::int32 value);<br />
  inline void add_id(::google::protobuf::int32 value);<br />
  inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&#038;<br />
      id() const;<br />
  inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*<br />
      mutable_id();<br />
…</p>
<p>But my problem is put the “vector&lt;int&gt;” as data into the Berkeley DB, how can I do this with the Protocol Buffers? Finally, each protocol buffer class has methods for writing and reading messages of your chosen type using the protocol buffer binary format. These include:</p>
<p>    * bool SerializeToString(string* output) const;: serializes the message and stores the bytes in the given string. Note that the bytes are binary, not text; we only use the string class as a convenient container.<br />
    * bool ParseFromString(const string&#038; data);: parses a message from the given string.<br />
    * bool SerializeToOstream(ostream* output) const;: writes the message to the given C++ ostream.<br />
* bool ParseFromIstream(istream* input);: parses a message from the given C++ istream.</p>
<p><strong>SerializeToString</strong> is the key function for me to serialize the “vector&lt;int&gt;” as the bytes string to store in the Berkeley DB:<br />
&#8230;<br />
string docid_string;<br />
if (!docid.SerializeToString(&#038;docid_string)) {<br />
…<br />
}<br />
&#8230;</p>
<p>When I want get the “vector&lt;int&gt;” from the Berkeley DB, I can use <strong>ParseFromString</strong>:<br />
&#8230;<br />
if (docid.ParseFromString(docid_string)) {<br />
…<br />
}<br />
&#8230;</p>
<p>That’s all! Google’s Protocol Buffers are really beautiful and easy!</p>
<p>Posted by <a href="http://www.52nlp.com/">52nlp</a></p>
<p>Related posts:<ol>
<li><a href='http://www.52nlp.com/how-to-start-new-process-or-run-shell-commands-within-python/' rel='bookmark' title='How to start new process or run shell commands within python?'>How to start new process or run shell commands within python?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.52nlp.com/googles-protocol-buffers-beautiful-and-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moses Support Digest: CALL FOR PAPERS &#8211; PBML</title>
		<link>http://www.52nlp.com/moses-support-digest-call-for-papers-pbml/</link>
		<comments>http://www.52nlp.com/moses-support-digest-call-for-papers-pbml/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 14:16:57 +0000</pubDate>
		<dc:creator>52nlp</dc:creator>
				<category><![CDATA[Moses]]></category>
		<category><![CDATA[SMT]]></category>
		<category><![CDATA[moses]]></category>
		<category><![CDATA[pbml]]></category>
		<category><![CDATA[support]]></category>

		<guid isPermaLink="false">http://www.52nlp.com/?p=379</guid>
		<description><![CDATA[[Moses-support] CALL FOR PAPERS &#8211; PBML CALL FOR PAPERS: OPEN SOURCE TOOLS FOR MACHINE TRANSLATION The Fifth Machine Translation Marathon, which will take place September 13-18 in Le Mans, France, is hosting an Open Source Convention to advance the state &#8230; <a href="http://www.52nlp.com/moses-support-digest-call-for-papers-pbml/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.52nlp.com/moses-support-digest-acl-wmt-2010-machine-translation-shared-task/' rel='bookmark' title='Moses Support Digest:Call for Participation ACL WMT 2010 Machine Translation Shared Task'>Moses Support Digest:Call for Participation ACL WMT 2010 Machine Translation Shared Task</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-about-createondiskpt-parameter/' rel='bookmark' title='Moses Support Digest: about CreateOnDiskPt parameter'>Moses Support Digest: about CreateOnDiskPt parameter</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-opentms-supports-moses-as-a-data-source/' rel='bookmark' title='Moses Support Digest:openTMS supports Moses as a data source'>Moses Support Digest:openTMS supports Moses as a data source</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-copyright-application-issue-for-a-snippet-translation-system-using-moses/' rel='bookmark' title='Moses Support Digest: Copyright application issue for a Snippet Translation System using MOSES'>Moses Support Digest: Copyright application issue for a Snippet Translation System using MOSES</a></li>
<li><a href='http://www.52nlp.com/cannot-find-loolm/' rel='bookmark' title='Moses Support Digest: cannot find -loolm'>Moses Support Digest: cannot find -loolm</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-translation-from-english-to-foreign-language/' rel='bookmark' title='Moses Support Digest:Translation from English to Foreign Language'>Moses Support Digest:Translation from English to Foreign Language</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-experiment-perl-publications-documentation/' rel='bookmark' title='Moses Support Digest: Experiment.perl publications &amp; documentation'>Moses Support Digest: Experiment.perl publications &#038; documentation</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-suffix-arrays-in-moses/' rel='bookmark' title='Moses Support Digest:Suffix arrays in Moses'>Moses Support Digest:Suffix arrays in Moses</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-installation/' rel='bookmark' title='Moses Support Digest: moses installation'>Moses Support Digest: moses installation</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-liscencing-terms-when-used-in-a-commercial-product/' rel='bookmark' title='Moses Support Digest:Moses liscencing terms when used in a commercial product'>Moses Support Digest:Moses liscencing terms when used in a commercial product</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong>[Moses-support] CALL FOR PAPERS &#8211; PBML</strong></p>
<p>                     CALL FOR PAPERS:<br />
   OPEN SOURCE TOOLS FOR MACHINE TRANSLATION<br />
 The Fifth Machine Translation Marathon, which will take place September<br />
13-18 in Le Mans, France, is hosting an Open Source Convention to<br />
 advance the state of the art in machine translation. The MT Marathon<br />
is organised by the computer science laboratory of Le Mans (LIUM) and the<br />
 University of Le Mans on behalf of the EuroMatrixPlus Consortium.<br />
 We invite developers of open source tools to present their work and<br />
 submit a paper of up to 10 pages that (a) describes the underlying<br />
methodology and (b) includes instructions how to use the tools.<br />
 We are looking for stand-alone tools and extensions of existing tools,<br />
such as the Moses open source systems. Accepted papers will be<br />
 presented during the MT Marathon and published as a special issue of<br />
the Prague Bulletin of Mathematical Linguistics (</p>
<p>http://ufal.mff.cuni.cz/pbml).</p>
<p> Possible topics:<br />
 * training of machine translation models<br />
* machine translation decoders<br />
* tuning of machine translation systems<br />
 * evaluation of machine translation<br />
* visualization, annotation or debugging tools<br />
 * tools for human translators<br />
* interfaces for web-based services or APIs<br />
 * extensions of existing tools<br />
* other tools for machine translation<br />
 This is the third time that the MT Marathon will host the Open Source<br />
Convention. The papers from previous years are available online:</p>
<p>http://ufal.mff.cuni.cz/pbml-91-100.html</p>
<p> Papers will be reviewed by two reviewers appointed by the program<br />
committee<br />
 e.g. papers which will be marked as the best by the reviewers (with no<br />
substantial<br />
modifications required) will be printed as usual in the PBML journal in time<br />
for the MT Marathon.<br />
 Others will be printed after requested modifications in the next PBML<br />
issue.<br />
 Important dates:<br />
 Deadline for paper submission: August 1 2010<br />
 Notification of acceptance: August 7 2010<br />
Camera-ready paper due: August 14 2010<br />
 Presentations: September 13-17 2010 (at the MT Marathon in Le Mans)<br />
Camera-ready (next issue) : 15 December 2010<br />
 Please send full non-anonymous submissions in PDF to Philipp Koehn <<br />
pkoehn at inf.ed.ac.uk><br />
        and the full Xe(La)TeX source for technical pre-review to Ondřej<br />
Bojar <bojar at ufal.mff.cuni.cz>.<br />
 Please use the PBML style files from</p>
<p>http://ufal.mff.cuni.cz/pbml-instructions.html</p>
<p> (follow the &#8220;short paper&#8221; track instructions).<br />
 Program Committee<br />
 Philipp Koehn<br />
Ondrej Bojar<br />
 Holger Schwenk<br />
Loïc Barrault</p>
<p>Related posts:<ol>
<li><a href='http://www.52nlp.com/moses-support-digest-acl-wmt-2010-machine-translation-shared-task/' rel='bookmark' title='Moses Support Digest:Call for Participation ACL WMT 2010 Machine Translation Shared Task'>Moses Support Digest:Call for Participation ACL WMT 2010 Machine Translation Shared Task</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-about-createondiskpt-parameter/' rel='bookmark' title='Moses Support Digest: about CreateOnDiskPt parameter'>Moses Support Digest: about CreateOnDiskPt parameter</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-opentms-supports-moses-as-a-data-source/' rel='bookmark' title='Moses Support Digest:openTMS supports Moses as a data source'>Moses Support Digest:openTMS supports Moses as a data source</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-copyright-application-issue-for-a-snippet-translation-system-using-moses/' rel='bookmark' title='Moses Support Digest: Copyright application issue for a Snippet Translation System using MOSES'>Moses Support Digest: Copyright application issue for a Snippet Translation System using MOSES</a></li>
<li><a href='http://www.52nlp.com/cannot-find-loolm/' rel='bookmark' title='Moses Support Digest: cannot find -loolm'>Moses Support Digest: cannot find -loolm</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-translation-from-english-to-foreign-language/' rel='bookmark' title='Moses Support Digest:Translation from English to Foreign Language'>Moses Support Digest:Translation from English to Foreign Language</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-experiment-perl-publications-documentation/' rel='bookmark' title='Moses Support Digest: Experiment.perl publications &amp; documentation'>Moses Support Digest: Experiment.perl publications &#038; documentation</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-suffix-arrays-in-moses/' rel='bookmark' title='Moses Support Digest:Suffix arrays in Moses'>Moses Support Digest:Suffix arrays in Moses</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-installation/' rel='bookmark' title='Moses Support Digest: moses installation'>Moses Support Digest: moses installation</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-liscencing-terms-when-used-in-a-commercial-product/' rel='bookmark' title='Moses Support Digest:Moses liscencing terms when used in a commercial product'>Moses Support Digest:Moses liscencing terms when used in a commercial product</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.52nlp.com/moses-support-digest-call-for-papers-pbml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moses Support Digest:  moses-irstlm memory racing with 5-gram lm</title>
		<link>http://www.52nlp.com/moses-support-digest-moses-irstlm-memory-racing-with-5-gram-lm/</link>
		<comments>http://www.52nlp.com/moses-support-digest-moses-irstlm-memory-racing-with-5-gram-lm/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 12:39:39 +0000</pubDate>
		<dc:creator>52nlp</dc:creator>
				<category><![CDATA[Moses]]></category>
		<category><![CDATA[SMT]]></category>
		<category><![CDATA[IRSTLM]]></category>
		<category><![CDATA[moses]]></category>
		<category><![CDATA[support]]></category>

		<guid isPermaLink="false">http://www.52nlp.com/?p=377</guid>
		<description><![CDATA[[Moses-support] moses-irstlm memory racing with 5-gram lm I&#8217;m troubleshooting a new moses system with these components: 1) GIZA++ (SVN rev 8, v 1.0.3) 2) IRSTLM (SVN rev 38, v 5.40.01) 3) Moses (SVN rev 3210, dated 4-26-2010) 4) Ubuntu-server 10.04 &#8230; <a href="http://www.52nlp.com/moses-support-digest-moses-irstlm-memory-racing-with-5-gram-lm/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-seems-to-hang/' rel='bookmark' title='Moses Support Digest: Moses seems to hang'>Moses Support Digest: Moses seems to hang</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-word-lattice-and-multiple-translation-tables-optimization-problem/' rel='bookmark' title='Moses Support Digest:word lattice and multiple translation tables optimization problem'>Moses Support Digest:word lattice and multiple translation tables optimization problem</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-a-translation-chain-prototype-with-moses-irstlm/' rel='bookmark' title='Moses Support Digest:A translation chain prototype with Moses + IRSTLM'>Moses Support Digest:A translation chain prototype with Moses + IRSTLM</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-confusionnet-getsubstring-error-when-using-lattice-with-utf8-input/' rel='bookmark' title='Moses Support Digest:ConfusionNet GetSubString error when using lattice with UTF8 input'>Moses Support Digest:ConfusionNet GetSubString error when using lattice with UTF8 input</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-createberkeleypt-and-on-disk-rule-table/' rel='bookmark' title='Moses Support Digest:CreateBerkeleyPt and On-Disk Rule Table'>Moses Support Digest:CreateBerkeleyPt and On-Disk Rule Table</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-tuning-failure-with-language-model-type-unknown/' rel='bookmark' title='Moses Support Digest:Tuning failure with Language model type unknown'>Moses Support Digest:Tuning failure with Language model type unknown</a></li>
<li><a href='http://www.52nlp.com/moses-support-digestmert-extractor/' rel='bookmark' title='Moses Support Digest:mert extractor'>Moses Support Digest:mert extractor</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-on-the-iphone/' rel='bookmark' title='Moses Support Digest: Moses on the iPhone'>Moses Support Digest: Moses on the iPhone</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-about-mert-moses-in-mose-chart/' rel='bookmark' title='Moses Support Digest: About mert-moses in mose-chart'>Moses Support Digest: About mert-moses in mose-chart</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-release/' rel='bookmark' title='Moses Support Digest: Moses release'>Moses Support Digest: Moses release</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong>[Moses-support] moses-irstlm memory racing with 5-gram lm</strong></p>
<p>I&#8217;m troubleshooting a new moses system with these components:<br />
  1) GIZA++ (SVN rev 8, v 1.0.3)<br />
  2) IRSTLM (SVN rev 38, v 5.40.01)<br />
  3) Moses (SVN rev 3210, dated 4-26-2010)<br />
  4) Ubuntu-server 10.04 LTS 64-bit.<br />
  5) 3.4 Ghz Pentium-D with 4gb ram.</p>
<p>Using a 3-gram lm, the system works as expected. Training, tuning and<br />
evaluation a small (135K pairs) en-nl subset of europarl.v5 work fine. BLEU<br />
score was 23. </p>
<p>I then built a 5-gram model, edited the moses.ini config and started<br />
mert-moses-new. It creates a filtered model, and then launches moses. The<br />
memory usage grows and within 10 minutes, the system kills moses.</p>
<p>In both cases, the lm is only the target half of the bitext corpus, about<br />
135K lines.</p>
<p>The moses.ini files:</p>
<p>[lmodel-file]<br />
1 0 3 /media/models/irstlm/europarl.v5.mini/3-gram.nl.blm</p>
<p>[lmodel-file]<br />
1 0 5 /media/models/irstlm/europarl.v5.mini/5-gram.nl.blm</p>
<p>I know of one other who has anyone the same problem with the 4-1-2010<br />
moses build and irstlm from March/April last year.</p>
<p>Any suggestions? Could it be the new Ubuntu or the g++-4.4.1 compiler? </p>
<p>Thanks,<br />
Tom<br />
<span id="more-377"></span><br />
<strong>Re: [Moses-support] moses-irstlm memory racing with 5-gram lm</strong></p>
<p>i&#8217;m not an expert on irstlm but i think you have to rename or softlink<br />
the file so that the extension ends in .mm to minimise memory usage.</p>
<p>http://www.statmt.org/moses/?n=FactoredTraining.BuildingLanguageModel#ntoc7</p>
<p>otherwise it&#8217;ll just allocate as much memory as needed to load the LM file</p>
<p><strong>Re: [Moses-support] moses-irstlm memory racing with 5-gram lm</strong></p>
<p>Problem solved. </p>
<p>To review the symptoms, I ran the following two mert-moses-new.pl command<br />
lines:</p>
<p>CASE 1:<br />
nice mert-moses-new.pl<br />
   /media/models/tables/europarl.v5.mini/en-nl/mert.irstlm.3.en-nl/mert.en</p>
<p>   /media/models/tables/europarl.v5.mini/en-nl/mert.irstlm.3.en-nl/mert.nl</p>
<p>   /usr/local/lib/moses-irstlm/moses-cmd/src/moses </p>
<p>/media/models/tables/europarl.v5.mini/en-nl/mert.irstlm.3.en-nl/moses0.ini</p>
<p>   &#8211;working-dir<br />
/media/models/tables/europarl.v5.mini/en-nl/mert.irstlm.3.en-nl<br />
   &#8211;rootdir /usr/local/lib/moses-irstlm/scripts<br />
   &#8211;mertdir=/usr/local/lib/moses-irstlm/mert<br />
   &#8211;nbest=50<br />
   &#8211;decoder-flags -v 0</p>
<p>CASE 2:<br />
nice mert-moses-new.pl<br />
   /media/models/tables/europarl.v5.mini/en-nl/mert.irstlm.5.en-nl/mert.en</p>
<p>   /media/models/tables/europarl.v5.mini/en-nl/mert.irstlm.5.en-nl/mert.nl</p>
<p>   /usr/local/lib/moses-irstlm/moses-cmd/src/moses </p>
<p>/media/models/tables/europarl.v5.mini/en-nl/mert.irstlm.5.en-nl/moses0.ini</p>
<p>   &#8211;working-dir<br />
/media/models/tables/europarl.v5.mini/en-nl/mert.irstlm.5.en-nl<br />
   &#8211;rootdir /usr/local/lib/moses-irstlm/scripts<br />
   &#8211;mertdir=/usr/local/lib/moses-irstlm/mert<br />
   &#8211;nbest=50<br />
   &#8211;decoder-flags -v 0</p>
<p>Only one line (the lmodel-file) was different in the respective starting<br />
config files:</p>
<p>CASE 1:<br />
/media/models/tables/europarl.v5.mini/en-nl/mert.irstlm.3.en-nl/moses0.ini:<br />
[ttable-file]<br />
0 0 0 5<br />
/media/models/tables/europarl.v5.mini/en-nl/model.en-nl/phrase-table.gz<br />
[lmodel-file]<br />
1 0 3 /media/models/irstlm/europarl.v5.mini/3-gram.nl.blm.mm<br />
[distortion-file]<br />
0-0 wbe-msd-bidirectional-fe-allff 6<br />
/media/models/tables/europarl.v5.mini/en-nl/model.en-nl/reordering-table.wbe-msd-bidirectional-fe.gz</p>
<p>CASE 2:<br />
/media/models/tables/europarl.v5.mini/en-nl/mert.irstlm.5.en-nl/moses0.ini:<br />
[ttable-file]<br />
0 0 0 5<br />
/media/models/tables/europarl.v5.mini/en-nl/model.en-nl/phrase-table.gz<br />
[lmodel-file]<br />
1 0 5 /media/models/irstlm/europarl.v5.mini/5-gram.nl.blm.mm<br />
[distortion-file]<br />
0-0 wbe-msd-bidirectional-fe-allff 6<br />
/media/models/tables/europarl.v5.mini/en-nl/model.en-nl/reordering-table.wbe-msd-bidirectional-fe.gz</p>
<p>In both cases, mert-moses-new.pl filtered the phrase table successfully.<br />
In CASE 1, the tuning process continued and concluded with a final<br />
moses.ini file with new weights. In CASE 2, however, mert-moses-new.pl<br />
created run1.moses.ini. The moses process rapidly (less than 5 minutes)<br />
consumed all RAM and virtual memory leaving nothing for other processes. It<br />
never sent output to the run1.out file. The system killed moses and<br />
mert-moses-new.pl. This occurred from the mert-moses-new.pl script or from<br />
the command line using the run1.moses.ini file.</p>
<p>Furthermore, I changed run1.moses.ini to use the binarized phrase and<br />
reordering tables:<br />
0 0 0 5<br />
/media/models/tables/europarl.v5.mini/en-nl/model.en-nl/phrase-table.gz<br />
  changed to:<br />
1 0 0 5<br />
/media/models/tables/europarl.v5.mini/en-nl/model.en-nl/phrase-table</p>
<p>0-0 wbe-msd-bidirectional-fe-allff 6<br />
/media/models/tables/europarl.v5.mini/en-nl/model.en-nl/reordering-table.wbe-msd-bidirectional-fe.gz<br />
  changed to<br />
0-0 wbe-msd-bidirectional-fe-allff 6<br />
/media/models/tables/europarl.v5.mini/en-nl/model.en-nl/reordering-table.wbe-msd-bidirectional-fe</p>
<p>With this modified config from the command line (not mert-moses-new.pl),<br />
moses loaded in seconds and translated stdin/stdout just fine. Only<br />
configurations with the full .gz model and filtered model exhibited the<br />
problems. The filtered model, by the way, is only 20 MB for phrase AND<br />
reordering tables.</p>
<p>SOLUTION:<br />
When I first built IRSTLM with MACHTYPE=x86_64, it created<br />
$IRSTLM/bin/x86_64. Then, building moses using &#8211;with-irstlm=$IRSTLM<br />
finished without fatal errors. I recently read the moses-support threads<br />
about using a $SRILM/bin/i686 folder. So, I applied the same solution to<br />
IRSTLM. I rebuilt IRSTLM and I created two symlinks:<br />
   ln -s $IRSTLM/bin/x86_64 $IRSTLM/bin/i686<br />
   ln -s $IRSTLM/lib/x86_64 $IRSTLM/lib/i686</p>
<p>Then, I rebuild moses &#8211;with-irstlm=$IRSTLM. </p>
<p>RESULTS: the mert-moses-new.pl script runs flawlessly with 3-gram and<br />
5-gram IRSTLM language models and the exact same config files in CASE 1 and<br />
CASE 2 above. </p>
<p>Go figure!</p>
<p>Hope this helps others.</p>
<p>Tom</p>
<p>Related posts:<ol>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-seems-to-hang/' rel='bookmark' title='Moses Support Digest: Moses seems to hang'>Moses Support Digest: Moses seems to hang</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-word-lattice-and-multiple-translation-tables-optimization-problem/' rel='bookmark' title='Moses Support Digest:word lattice and multiple translation tables optimization problem'>Moses Support Digest:word lattice and multiple translation tables optimization problem</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-a-translation-chain-prototype-with-moses-irstlm/' rel='bookmark' title='Moses Support Digest:A translation chain prototype with Moses + IRSTLM'>Moses Support Digest:A translation chain prototype with Moses + IRSTLM</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-confusionnet-getsubstring-error-when-using-lattice-with-utf8-input/' rel='bookmark' title='Moses Support Digest:ConfusionNet GetSubString error when using lattice with UTF8 input'>Moses Support Digest:ConfusionNet GetSubString error when using lattice with UTF8 input</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-createberkeleypt-and-on-disk-rule-table/' rel='bookmark' title='Moses Support Digest:CreateBerkeleyPt and On-Disk Rule Table'>Moses Support Digest:CreateBerkeleyPt and On-Disk Rule Table</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-tuning-failure-with-language-model-type-unknown/' rel='bookmark' title='Moses Support Digest:Tuning failure with Language model type unknown'>Moses Support Digest:Tuning failure with Language model type unknown</a></li>
<li><a href='http://www.52nlp.com/moses-support-digestmert-extractor/' rel='bookmark' title='Moses Support Digest:mert extractor'>Moses Support Digest:mert extractor</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-on-the-iphone/' rel='bookmark' title='Moses Support Digest: Moses on the iPhone'>Moses Support Digest: Moses on the iPhone</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-about-mert-moses-in-mose-chart/' rel='bookmark' title='Moses Support Digest: About mert-moses in mose-chart'>Moses Support Digest: About mert-moses in mose-chart</a></li>
<li><a href='http://www.52nlp.com/moses-support-digest-moses-release/' rel='bookmark' title='Moses Support Digest: Moses release'>Moses Support Digest: Moses release</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.52nlp.com/moses-support-digest-moses-irstlm-memory-racing-with-5-gram-lm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

