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 πŸŽ€

  • -nlr forward_ngram.arpa β€” read in a forward (left-to-right) word N-gram file in ARPA standard format. πŸ’«
  • -nrl backward_ngram.arpa β€” read in a backward (right-to-left) word N-gram file in ARPA standard format. 🌈
  • -d old_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 (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