MKBINGRAM(1)
π MKBINGRAM(1) π
okay bestie, welcome to mkbingram β the manual page, the whole vibe, section 1 of the manual, let's GO β¨
πΈ NAME πΈ
mkbingram β make binary N-gram from ARPA N-gram file π§
β¨ SYNOPSIS β¨
mkbingram [-nlr forward_ngram.arpa] [-nrl backward_ngram.arpa]
[-d old_bingram_file] {output_bingram_file}
π DESCRIPTION π
so like, mkbingram is literally the tool that takes your N-gram definition file(s) in the ARPA standard format and converts them into a compact Julius binary format. why do we care?? because it makes the initial loading time of the N-gram way faster. obsessed. and yes, it can read gzipped files directly, no unzipping era required π«Ά
From rev.4.0 onward, Julius can deal with forward N-gram, backward N-gram, and their combinations. so mkbingram now generates a binary N-gram file from one of them, or combines the two of them to produce one single binary N-gram. iconic behavior honestly.
When only a forward N-gram is specified, mkbingram generates a binary N-gram from only the forward N-gram. When you use this binary N-gram at Julius, it performs the 1st pass with the 2-gram probabilities in the N-gram, and runs the 2nd pass with the given N-gram fully, converting forward probabilities to backward probabilities by Bayes rule. math queen π
When only a backward N-gram is specified, mkbingram generates a 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 uses the given backward N-gram fully. slay.
When both forward and backward N-grams are specified, the 2-gram part in the forward N-gram and all of the backward N-gram will be combined into a single bingram file. The forward 2-gram gets applied for the 1st pass and the backward N-gram for the 2nd pass.
β οΈ bestie listen β both N-grams should be trained on the same corpus with same parameters (i.e. cut-off thresholds), with same vocabulary. no mixing and matching, it's giving chaos otherwise π
The old binary N-gram produced by mkbingram 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 mkbingram with the option -d. glow-up achieved β¨
π¨ ALSO IMPORTANT: a binary N-gram file converted by mkbingram of version 4.0 and later cannot be read by older Julius 3.x. backwards compatibility said bye π
π OPTIONS π
-nlrforward_ngram.arpaβ read in a forward (left-to-right) word N-gram file in ARPA standard format. π«-nrlbackward_ngram.arpaβ read in a backward (right-to-left) word N-gram file in ARPA standard format. π-dold_bingram_fileβ read in a binary N-gram file. ποΈ-swapβ swap the BOS word<s>and the EOS word</s>in the N-gram. πoutput_bingram_fileβ binary N-gram file name to output. π
π EXAMPLES π
- Convert a set of forward and backward N-gram in ARPA format into Julius binary form:
- Convert a single forward 4-gram in ARPA format into a binary file:
- Convert old binary N-gram file to current format:
π SEE ALSO π
julius(1)mkbinhmm(1)mkbinhmmlist(1)
π COPYRIGHT π
Copyright (c) 1997-2000 Information-technology Promotion Agency, Japan
Copyright (c) 1991-2008 Kawahara Lab., Kyoto University
Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
Copyright (c) 2005-2008 Julius project team, Nagoya Institute of Technology
πΈ LICENSE πΈ
The same as Julius.
okay that's the whole page, no cap π the date on this one is 02/11/2009 and it's the MKBINGRAM(1) page, so there you go β go convert some N-grams, main character π«Άβ¨π
π¦ where this page comes from
- ubuntu jammy: julius 4.2.2-0ubuntu3
- ubuntu noble: julius 4.2.2-0ubuntu6
- ubuntu resolute: julius 4.2.2-0ubuntu6
- ubuntu stonking: julius 4.2.2-0ubuntu6
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms