.\" Title:
mkbingram
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.71.0
.\" Date: 02/11/2009
.\" Manual:
.\" Source:
.\"
.TH "MKBINGRAM" "1" "02/11/2009" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
mkbingram
\- make binary N\-gram from ARPA N\-gram file
.SH "SYNOPSIS"
.HP 10
\fBmkbingram\fR [\-nlr\ \fIforward_ngram.arpa\fR] [\-nrl\ \fIbackward_ngram.arpa\fR] [\-d\ \fIold_bingram_file\fR] {output_bingram_file}
.SH "DESCRIPTION"
.PP
\fBmkbingram\fR
is a tool to convert N\-gram definition file(s) in ARPA standard format to a compact Julius binary format. It will speed up the initial loading time of N\-gram much faster. It can read gzipped file directly.
.PP
From rev.4.0, Julius can deal with forward N\-gram, backward N\-gram and their combinations. So,
\fBmkbingram\fR
now generates binary N\-gram file from one of them, or combining them two to produce one binary N\-gram.
.PP
When only a forward N\-gram is specified,
\fBmkbingram\fR
generates binary N\-gram from only the forward N\-gram. When using this binary N\-gram at Julius, it performs the 1st pass with the 2\-gram probabilities in the N\-gram, and run the 2nd pass with the given N\-gram fully, with converting forward probabilities to backward probabilities by Bayes rule.
.PP
When only a backward N\-gram is specified,
\fBmkbingram\fR
generates an binary N\-gram file that contains only the backward N\-gram. The 1st pass will use forward 2\-gram probabilities that can be computed from the backward 2\-gram using Bayes rule, and the 2nd pass use the given backward N\-gram fully.
.PP
When both forward and backward N\-grams are specified, the 2\-gram part in the forward N\-gram and all backward N\-gram will be combined into single bingram file. The forward 2\-gram will be applied for the 1st pass and backward N\-gram for the 2nd pass. Note that both N\-gram should be trained in the same corpus with same parameters (i.e. cut\-off thresholds), with same vocabulary.
.PP
The old binary N\-gram produced by
\fBmkbingram\fR
of version 3.x and earlier can be used in Julius\-4, but you can convert the old version to the new version by specifying it as input of current
\fBmkbingram\fR
by option "\fB\-d\fR".
.PP
Please note that binary N\-gram file converted by
\fBmkbingram\fR
of version 4.0 and later cannot be read by older Julius 3.x.
.SH "OPTIONS"
.PP
\fB \-nlr \fR \fIforward_ngram.arpa\fR
.RS 3n
Read in a forward (left\-to\-right) word N\-gram file in ARPA standard format.
.RE
.PP
\fB \-nrl \fR \fIbackward_ngram.arpa\fR
.RS 3n
Read in a backward (right\-to\-left) word N\-gram file in ARPA standard format.
.RE
.PP
\fB \-d \fR \fIold_bingram_file\fR
.RS 3n
Read in a binary N\-gram file.
.RE
.PP
\fB \-swap \fR
.RS 3n
Swap BOS word and EOS word in N\-gram.
.RE
.PP
\fIoutput_bingram_file\fR
.RS 3n
binary N\-gram file name to output.
.RE
.SH "EXAMPLES"
.PP
Convert a set of forward and backward N\-gram in ARPA format into Julius binary form:
.sp .RS 3n .nf % \fBmkbingram\fR \-nlr 2gram.arpa \-nrl rev\-Ngram.arpa outfile .fi .RE
Convert a single forward 4\-gram in ARPA format into a binary file:
.sp .RS 3n .nf % \fBmkbingram\fR \-nlr 4gram.arpa outfile .fi .RE
Convert old binary N\-gram file to current format:
.sp .RS 3n .nf % \fBmkbingram\fR \-d old_bingram new_bingram .fi .RE
.SH "SEE ALSO"
.PP
\fB julius \fR( 1 )
,
\fB mkbinhmm \fR( 1 )
,
\fB mkbinhmmlist \fR( 1 )
.SH "COPYRIGHT"
.PP
Copyright (c) 1997\-2000 Information\-technology Promotion Agency, Japan
.PP
Copyright (c) 1991\-2008 Kawahara Lab., Kyoto University
.PP
Copyright (c) 2000\-2005 Shikano Lab., Nara Institute of Science and Technology
.PP
Copyright (c) 2005\-2008 Julius project team, Nagoya Institute of Technology
.SH "LICENSE"
.PP
The same as Julius.