All demos
N-Gram Graph Lab
Read an n-gram model as a graph
The probability table can also be drawn as a network: contexts become nodes and possible next words become weighted arrows. Following arrows generates text one choice at a time.
Try this
- Choose a text and n-gram size, then inspect the table and graph.
- Set a generation start context.
- Step through choices and watch the active path on the graph.
Nodes are contexts. Arrows are possible generated words. Thicker arrows are more likely, and highlighted arrows are the choices available from the current context. A dashed outer ring means generation can stop at that context or continue from it.
| Context | Next word | Count | Probability |
|---|
Generated sentence
Current context
Tokens0
Vocabulary0
Contexts0
One choice0
Dead ends0
Repeated paths0