No description
Find a file
2025-03-14 12:13:42 -04:00
src add default 2025-03-14 12:09:54 -04:00
.gitignore initial commit 2025-03-14 12:02:13 -04:00
Cargo.lock initial commit 2025-03-14 12:02:13 -04:00
Cargo.toml initial commit 2025-03-14 12:02:13 -04:00
output.ron initial commit 2025-03-14 12:02:13 -04:00
README.md update readme 2025-03-14 12:13:42 -04:00

Simple Trigram Language Model

To install:

  1. Make sure you have cargo/rust installed (if not, install from here: https://rustup.rs/)
  2. Install with the following command:
    cargo install --git https://git.sojuhokari.com/sojuhokari/ngram.git
    
    (if you've already installed once before and are trying to update, run it with the --force flag)

Calculate parameters

To calculate parameters based on a corpus, save some text as a text file (e.g. hello.txt). Then, run the following command to create parameters based on that file:

ngram estimate hello.txt -o parameters.ron

Produce language

To produce a sentence, run the following:

ngram produce parameters.ron

Alternatively, run the following in order to use the pre-calculated parameters based on my honors thesis:

ngram produce

To see all options, run ngram help