NGRAMMERGE(1)

πŸ“¦
version 1.3.17 Β· 3 versions
, in fedora 44

✨ 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 in replace_merge, and it's ignored if < 1. So if you set it to 0 or 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. Hit 1048576 bytes 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 by TestProperties.
  • --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, ipairs and opairs are 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: kError property set, FST weights: not a Member(). 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_fatal flags default to true. 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 size 0 (none) or 2 (open and close parenthesis). Size 1? Not allowed. Size 3? 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