



\section{
\label{faq.tex}
Frequently Asked Questions}


\subsection{
\label{faq.texntoc1}My system is taking a really long time to translate a sentence. What can I do to speed it up ?}


The single best thing you can do is to binarize the phrase tables and language models. See question below also.



\subsection{
\label{faq.texntoc2}The system runs out of memory during decoding. }


Filter and binarize your phrase tables. Binarize your language models using the IRSTLM. Binarize your lexicalized re-ordering table.



Binarizing the phrase table helps decrease memory usage as only phrase pairs that are needed for each sentence are read from file into memory. Similarly for language models and lexicalized reordering models.



This webpage\footnote{\sf http://www.statmt.org/moses/?n=Moses.AdvancedFeatures} tell you how to binarize the models.



\subsection{
\label{faq.texntoc3}I would like to point out a bug / contribute code.}


We are always grateful for bug reports and code contribution. Send it to an existing Moses developer you work with, or send it to Hieu Hoang at Edinburgh University.



If you want to check it code yourself, create a github account here\footnote{\sf https://github.com/}



Then ask one of the project admins to add you to the Moses project. The admins are currently

\begin{compactitem}
\item Barry Haddow

\item Hieu Hoang

\item Nicola Bertoldi

\item Ondrej Bojar

\item Kenneth Heafield

\end{compactitem}

We will probably ask to code review you a few times before giving you free reign. However, there is less oversight if you intend to work on your own branch, rather than the trunk.



\subsection{
\label{faq.texntoc4}How can I get an updated version of Moses ?}


The best way is using git. 



From the command line, type

\begin{SaveVerbatim}{myverb}
git pull
\end{SaveVerbatim}
\begin{shaded}
\small
\UseVerbatim{myverb}
\end{shaded}

Or use whatever GUI client you have.



\subsection{
\label{faq.texntoc5}What changed in the latest release of Moses?}


See Releases (Section \ref{releases.tex})



\subsection{
\label{faq.texntoc6}I am an undergrad/masters student looking for a project in SMT. What should I do?}


Email the mailing list with the title: 'Code monkey available. Will work for peanuts' !
Seriously, there's lots and lots of projects available. There has been 3-4 months projects in the past which have made a significant contribution to the community and have been integrated into the Moses toolkit.  Your contribution will be grateful appreciated. 
Talk to your professor in the first instance, then talk to us. We maintain a list of interesting projects (Section \ref{get-involved.tex}).



\subsection{
\label{faq.texntoc7}What do the 5 numbers in the phrase table mean?}


See the section on phrase scoring\footnote{\sf http://www.statmt.org/moses/?n=FactoredTraining.ScorePhrases}



\subsection{
\label{faq.texntoc8}What OS does Moses run on?}


It depends on which part.



The decoder can be compiled and run on Linux (32 and 64-bits), Windows, Cygwin, Mac OSX (Intel and PowerPC). Unconfirmed reports of the decoder running on Solaris and BSD too.



The training and tuning scripts are regularly run on Linux (32 and 64-bits), and occasionally on Mac (Intel). The whole of the Moses pipeline should also run on Windows under Cygwin, however, this has not been confirmed. If you are able to run under Windows/Cygwin, please let us know and we can update this FAQ.



When running on non-Linux platforms, beware of the following issues:

\begin{compactitem}
\item File system case-sensitivity

\item {\tt zcat}, {\tt gzip} command line programs missing

\item Old GIZA++ versions only compilable by specific gcc versions

\item Availability of Sun Grid Engine

\end{compactitem}

Therefore, the only realistic OS to run the whole SMT pipeline on is Linux and Intel Mac.



\subsection{
\label{faq.texntoc9}Can I use Moses on Windows ?}


Yes. Moses compiles and runs in Cygwin exactly the same way as on Linux



There are a proviso though: 



Cygwin is 32-bit, even on 64 bit windows. The binary language models (KenLM, IRSTLM) need 64 bit to work with language models larger than about 2GB. This is the same as for 32 bit Linux.



\subsection{
\label{faq.texntoc10}Do I need a computer cluster to run experiments?}


The Moses toolkit uses SGE (Sun Grid Engine) cluster to parallelize tasks. Even though it is not strictly necessary to use a cluster to run your experiments, it is highly advisable to get your experiments to run faster.



The most CPU intensive task is the tuning of the weights (MERT tuning). As an indication, a Europarl trained model, using 2000 sentences for tuning, takes 1-2 days to tune using 15 CPUs. 10-15 iterations are typical.



\subsection{
\label{faq.texntoc11}I have compiled Moses, but it segfaults when running.}


Moses should not segfault, so the Moses developers would like to hear about it.



First of all, try to identify the fault yourself. The most common error is the ini file is not correct, or the sentence input is badly formatted.



If necessary, you can debug the system by stepping through the source code. We put a lot of effort into making the code easy to read and debug. Also, the decoder comes with Visual Studio and XCode project file to help you debug in a GUI environment.



If you still can not find the solution, email the mailing list. Its useful to attach the ini file, the output just before it crashes, and any other info that you think may be useful to help resolve the problem.



\subsection{
\label{faq.texntoc12}How do I add a new feature function to the decoder?}


This is now documented in its own section (Section \ref{code-guide-ff.tex}).



\subsection{
\label{faq.texntoc13}Compiling with SRILM or IRSTLM produces errors.}


Firstly, make sure SRILM/IRSTLM themselves have compiled successfully. You should see be a libflm.a/libdstruct.a etc (for SRILM), or libirstlm.a. If these are not available, then something went wrong. SRILM and IRSTLM are external libraries so the Moses developers have limited say and knowledge of them.



SRI or IRST LM both have their own mailing list where you can ask questions if you have problem compiling them. See here for details:

\begin{compactitem}
\item SRILM\footnote{\sf http://www.speech.sri.com/mailman/listinfo/srilm-user}

\item IRSTLM\footnote{\sf https://list.fbk.eu/sympa/subscribe/user-irstlm}

\end{compactitem}

If Moses still does not compile successfully, look at the compile error to see where the compiler is trying to find these external libraries. Occasionally (especially when compiling on 64-bit machines), Moses expects the .a file in 1 sub-directory but they are in another. This is easily solved by moving copying the .a file to the place where Moses expect it to be.



\subsection{
\label{faq.texntoc14}I am trying to use Moses to create a web page to do translation.}


There is a subproject in Moses, in  {\tt contrib/web} , which allows you to set up a web page to translate other web pages. Its written in Perl and the installation is non-trivial. Follow the instructions carefully.



It doesn't translate ad-hoc sentences. If you have some code which allow translation of ad-hoc sentences, please share it with us !



\subsection{
\label{faq.texntoc15}How can a create a system that translate both ways, ie. X-to-Y as well as Y-to-X ?}


You need to do everything twice, and run 2 decoders. There is a lot of overlap between them, but the toolkit is designed to go 1 way at a time.



\subsection{
\label{faq.texntoc16}PhraseScore dies with signal 11 - why?}


This may happen means because you have a null byte in your data. Look at line 2 of model/lex.f2e.



Try this to find lines with null bytes in your original data:

\begin{SaveVerbatim}{myverb}
grep -Pc '[\000]' <files ...>
\end{SaveVerbatim}
\begin{shaded}
\small
\UseVerbatim{myverb}
\end{shaded}

(If your grep does not support Perl-style regular expression syntax ({\tt -P}), you will have to express that a different way.)



If this turns out to be the problem, and you don't want to run GIZA++ again from scratch, you can try the following:



First go into {\tt working-dir/model} and delete everything but the following:

\begin{SaveVerbatim}{myverb}
aligned.grow-diag-final-and
aligned.0.fr
aligned.0.en
lex.0-0.n2f
lex.0-0.f2n
\end{SaveVerbatim}
\begin{shaded}
\small
\UseVerbatim{myverb}
\end{shaded}

Now run this fragment of Perl:






\begin{SaveVerbatim}{myverb}
perl -i.BAD -pe 's/[\000]/NULLBYTE/g;' aligned.0* lex.0*
\end{SaveVerbatim}
\begin{shaded}
\small
\UseVerbatim{myverb}
\end{shaded}

This will replace every null byte in those four files, saving the old version out to {\tt *.BAD.}  (This may be overkill, for instance if only the foreign side has the problem.



Now restart the Moses training script with the same invocation as before, but tell it to start at step 5:






\begin{SaveVerbatim}{myverb}
train-model.perl ... --first-step 5
\end{SaveVerbatim}
\begin{shaded}
\small
\UseVerbatim{myverb}
\end{shaded}

\subsection{
\label{faq.texntoc17}Does Moses do Hierarchical decoding, like Hiero etc?}


Yes. Check the Syntax Tutorial (Section \ref{syntax-tutorial.tex}).



\subsection{
\label{faq.texntoc18}Can I use Moses in proprietary software ?}


Moses is licensed under the LGPL. See here\footnote{\sf http://www.gnu.org/licenses/gpl-faq.html} for a thorough explanation of what this means.



Basically, if you are just using Moses unchanged, there are no license issues. You can also use the Moses library ({\tt libmoses.a}) in your own applications.
But if you want to distribute a modified version of Moses, you have to distribute the source code to the modifications.



\subsection{
\label{faq.texntoc19}GIZA++ crashes with error "parameter 'coocurrencefile' does not exist."}


You have a version of GIZA++ which does not support cooccurrence files. To add
support for cooccurrence files, you need to edit the GIZA++ Makefile and add
the flag {\tt -DBINARY\_SEARCH\_FOR\_TTABLE} to {\tt CFLAGS\_OPT}. Then you should rebuild
GIZA++.



\subsection{
\label{faq.texntoc20}Running regenerate-makefiles.sh gives me lots of errors about *GREP and *SED macros}


You should not be running this script. Moses moved from autotools to bjam in Autumn 2011.



\subsection{
\label{faq.texntoc21}Running training I got the following error "*** buffer overflow detected ***: ../giza-pp/GIZA++-v2/GIZA++ terminated"}


This error occurs during the word alignment step and is related to GIZA++, and not directly to the Moses Toolkit. Neverthless, the solution is described here\footnote{\sf http://www2.statmt.org/moses/?n=Moses.GizappBufferOverflow}.



\subsection{
\label{faq.texntoc22}I retrained my model and got different BLEU scores. Why?}


In general, Machine Translation training is non-convex.  this means
that there are multiple solutions and each time you run a full
training job, you will get different results.  In particular, you will
see different results when running GIZA++ (any flavour) and MERT.



The best way to deal with this (and most expensive) would be to run
the full pipe-line, from scratch and multiple times.  This will give
you a feel for variance -{}-differences in results.  In general,
variance arising from GIZA++ is less damaging than variance from MERT.



To reduce variance it is best to use as much data as possible at
each stage. It is possible to reduce this
variability by using better machine learning, but in general it will
always be there.



Another strategy is to fix everything once you have a
set of good weights and never rerun MERT.  Should you need to change
say the language model, you will then manually alter the associated
weight.  This will mean stability, but at the obvious cost of
generality.  it is also ugly.



See Clark et al.\footnote{\sf http://www.cs.cmu.edu/\textasciitilde{}jhclark/pubs/significance.pdf} for a discussion of some of these issues.



\subsection{
\label{faq.texntoc23}I specified ranges for mert weights, but it returned weights which are outwith those ranges}


The ranges that you pass to {\tt mert-moses.pl} (using the {\tt -{}-range} argument) are only used in the random restarts, so serve to guide mert rather than restrict it.



\subsection{
\label{faq.texntoc24}Who do I ask if my question has not been answered by this FAQ?}


Search the mailing list archive\footnote{\sf https://www.mail-archive.com/moses-support@mit.edu/}. If you still do not find the answer, then send questions to the mailing list 'moses-support'. However, you have to sign up\footnote{\sf http://mailman.mit.edu/mailman/listinfo/moses-support} before emailing.







\begin{center}\textit{\small Subsection last  modified on March 24, 2020, at 05:00 PM}\end{center}
