NGRAMMERGE(1)
β¨ NAME β¨
ngrammerge β it's the manual page for ngrammerge version 1.3.17, bestie π
πΈ DESCRIPTION πΈ
Okay so, real talk: ngrammerge merges n-gram models. That's the whole vibe. You feed it a bunch of FSTs and it smushes them together into one. Iconic behavior honestly π«Ά
Here's how you're supposed to call it:
Usage: ngrammerge [--options] -ofile=out.fst in1.fst in2.fst [in3.fst ...]
Like, yes, you do need -ofile for the output, and yes, you can throw in in3.fst and beyond if you're feeling extra. Not me being greedy with input files π
π PROGRAM FLAGS π
These are the flags that are like, hers. The main-character ones π
--alphaβ type =double, default =1. The weight for the first FST. It's giving "first FST gets a say" energy.--backoff_labelβ type =int64_t, default =0. The backoff label, periodt.--betaβ type =double, default =1. Weight for the second (and subsequent) FST(s). So yes, everything after the first one runs on beta β¨--check_consistencyβ type =bool, default =false. Checks model consistency. Turn it on if you want that reassurance, bestie.--completeβ type =bool, default =false. Completes partial models. Healing them, literally π§--context_patternβ type =std::string, default ="". The context pattern for the second FST.--contextsβ type =std::string, default ="". Context patterns file (all FSTs). All of them. Every single one π--max_replace_orderβ type =int32_t, default =-1. Maximum order to replace inreplace_merge, and it's ignored if < 1. So if you set it to0or anything negative, it just... doesn't care. Lowkey rude but okay π--methodβ type =std::string, default ="count_merge". One of:"context_merge","count_merge","model_merge","bayes_model_merge","histogram_merge","replace_merge". Six options, six whole personalities π--norm_epsβ type =double, default =0.001. Normalization check epsilon. Tiny number, big job.--normalizeβ type =bool, default =false. Normalizes the resulting model. Get it together, model π--ofileβ type =std::string, default ="". Output file. This is the one you actually came here for.--round_to_intβ type =bool, default =false. Rounds all merged counts to integers. No decimals allowed, no cap π«
π LIBRARY FLAGS π
These are the borrowed ones β the group chat that came with the library. Still important, still slay.
Flags from: flags.cc
--helpβ type =bool, default =false. Shows usage information. The classic. When in doubt, ask for help π₯Ί--helpshortβ type =bool, default =false. Shows brief usage information. Help but make it snack-sized.--tmpdirβ type =std::string, default ="/tmp". Temporary directory. Living in/tmp, rent free πΈ--vβ type =int32_t, default =0. Verbosity level. Crank it up if you want it to yap.
Flags from: fst.cc
--fst_alignβ type =bool, default =false. Write FST data aligned where appropriate. Alignment, but make it storage β¨--fst_default_cache_gcβ type =bool, default =true. Enable garbage collection of cache. Cleaning up after itself, we love a self-sufficient icon π§Ή--fst_default_cache_gc_limitβ type =int64_t, default =1048576. Cache byte size that triggers garbage collection. Hit1048576bytes and the GC wakes up π--fst_read_modeβ type =std::string, default ="read". Default file reading mode for mappable files.--fst_verify_propertiesβ type =bool, default =false. Verify FST properties queried byTestProperties.--save_relabel_ipairsβ type =std::string, default ="". Save input relabel pairs to file.--save_relabel_opairsβ type =std::string, default ="". Save output relabel pairs to file. (Yes,ipairsandopairsare two different flags. Input and output. Don't mix them up bestie π)
Flags from: ngram-output.cc
--end_symbolβ type =std::string, default ="</s>". Class label for sentence end. Goodbye symbol π«Ά--start_symbolβ type =std::string, default ="<s>". Class label for sentence start. Hello symbol π
Flags from: symbol-table.cc
--fst_compat_symbolsβ type =bool, default =true. Require symbol tables to match when appropriate. Matching outfits, but for symbol tables π―--fst_field_separatorβ type =std::string, default =" ". Set of characters used as a separator between printed fields. (That default is a whole run of spaces, so like β be aware π)
Flags from: util.cc
--fst_error_fatalβ type =bool, default =true. FST errors are fatal; o.w. return objects flagged as bad: e.g., FSTs:kErrorproperty set, FST weights: not aMember(). So by default, an FST error is a whole crisis. Turn it off and instead you get objects marked as bad instead of the program just dying π--ngram_error_fatalβ type =bool, default =true. NGram errors are fatal if true; otherwise returns objects flagged as bad: e.g.,NGramModel::Error()is true.
β οΈ Bestie listen β both of those_error_fatalflags default totrue. Fatal means fatal. If you'd rather get back a flagged-bad object instead of an abrupt goodbye, you gotta flip them yourself, no cap.
Flags from: weight.cc
--fst_weight_parenthesesβ type =std::string, default ="". Characters enclosing the first weight of a printed composite weight (e.g., pair weight, tuple weight and derived classes) to ensure proper I/O of nested composite weights; must have size0(none) or2(open and close parenthesis). Size1? Not allowed. Size3? Absolutely not. Zero or two, that's the rule π--fst_weight_separatorβ type =std::string, default =",". Character separator between printed composite weights; must be a single character. One character. Singular. That's it, that's the law π
And that's the whole page, bestie!! Every flag, every default, every little type signature β all of it, nothing skipped, we ate and left no crumbs π
This was ngrammerge version 1.3.17, from February 2022 β shouting out the source and the date one last time on the way out π Bye pookie, go merge some n-grams π¦
π¦ where this page comes from
- fedora 44: opengrm-ngram-tools 1.3.17-2.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms