About
This demo uses statistical language modeling to generate text. An n-gram model learns word sequences from a corpus and uses add-k smoothing to handle unseen combinations.
Generated Text
Generated text will appear here...
How it works: The model counts n-word sequences in the training text.
To generate text, it looks at the last (n-1) words and probabilistically chooses the next word
based on what followed that sequence in the training data.
Backoff smoothing: If an n-gram context hasn't been seen, the model automatically
backs off to shorter contexts ((n-1)-gram, (n-2)-gram, etc.) until it finds a match, eventually
falling back to unigram frequencies. This makes generation more robust and creative!